Code Monkey home page Code Monkey logo

Comments (6)

ahasselbring avatar ahasselbring commented on August 30, 2024

Hi,
could it somehow be that CompiledNN was compiled with assertions disabled (Release-like) and main with assertions enabled (Debug-like)? That would perfectly explain the output, but seems very unlikely given your build commands. Could you check (using make VERBOSE=1) whether -DNDEBUG is passed to the compiler in 1. the CompiledNN target and 2. the main target?

from compilednn.

b4rthm avatar b4rthm commented on August 30, 2024

I don't know. Here is the output of make VERBOSE=1 and I can't find the option -DNDEBUG .

/snap/cmake/192/bin/cmake -S/home/barth/Workspace/CompiledNN -B/home/barth/Workspace/CompiledNN/_build --check-build-system CMakeFiles/Makefile.cmake 0
/snap/cmake/192/bin/cmake -E cmake_progress_start /home/barth/Workspace/CompiledNN/_build/CMakeFiles /home/barth/Workspace/CompiledNN/_build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/barth/Workspace/CompiledNN/_build'
make -f CMakeFiles/CompiledNN.dir/build.make CMakeFiles/CompiledNN.dir/depend
make[2]: Entering directory '/home/barth/Workspace/CompiledNN/_build'
cd /home/barth/Workspace/CompiledNN/_build && /snap/cmake/192/bin/cmake -E cmake_depends "Unix Makefiles" /home/barth/Workspace/CompiledNN /home/barth/Workspace/CompiledNN /home/barth/Workspace/CompiledNN/_build /home/barth/Workspace/CompiledNN/_build /home/barth/Workspace/CompiledNN/_build/CMakeFiles/CompiledNN.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/barth/Workspace/CompiledNN/_build'
make -f CMakeFiles/CompiledNN.dir/build.make CMakeFiles/CompiledNN.dir/build
make[2]: Entering directory '/home/barth/Workspace/CompiledNN/_build'
make[2]: Nothing to be done for 'CMakeFiles/CompiledNN.dir/build'.
make[2]: Leaving directory '/home/barth/Workspace/CompiledNN/_build'
[ 97%] Built target CompiledNN
make -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/depend
make[2]: Entering directory '/home/barth/Workspace/CompiledNN/_build'
cd /home/barth/Workspace/CompiledNN/_build && /snap/cmake/192/bin/cmake -E cmake_depends "Unix Makefiles" /home/barth/Workspace/CompiledNN /home/barth/Workspace/CompiledNN /home/barth/Workspace/CompiledNN/_build /home/barth/Workspace/CompiledNN/_build /home/barth/Workspace/CompiledNN/_build/CMakeFiles/main.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/barth/Workspace/CompiledNN/_build'
make -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/build
make[2]: Entering directory '/home/barth/Workspace/CompiledNN/_build'
[ 98%] Linking CXX executable main
/snap/cmake/192/bin/cmake -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/main.dir/main.cpp.o -o main -Wl,-rpath,/home/barth/anaconda3/lib libCompiledNN.a -lpthread -lrt /home/barth/anaconda3/lib/libhdf5.so /usr/lib/x86_64-linux-gnu/librt.so -lpthread /home/barth/anaconda3/lib/libz.so /usr/lib/x86_64-linux-gnu/libdl.so -lm
CMakeFiles/main.dir/main.cpp.o: In function NeuralNetwork::CompiledNN::apply() const': main.cpp:(.text._ZNK13NeuralNetwork10CompiledNN5applyEv[_ZNK13NeuralNetwork10CompiledNN5applyEv]+0x3c): undefined reference to Assert::print(char const*, int, char const*, ...)'
main.cpp:(.text._ZNK13NeuralNetwork10CompiledNN5applyEv[_ZNK13NeuralNetwork10CompiledNN5applyEv]+0x41): undefined reference to `Assert::abort()'
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:90: recipe for target 'main' failed
make[2]: *** [main] Error 1
make[2]: Leaving directory '/home/barth/Workspace/CompiledNN/_build'
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/main.dir/all' failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make[1]: Leaving directory '/home/barth/Workspace/CompiledNN/_build'
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

from compilednn.

ahasselbring avatar ahasselbring commented on August 30, 2024

OK, while it would have certainly been interesting to see the output of the build of CompiledNN, too (i.e. after recreating the build directory), there is something else that is interesting: CMake seems to use the HDF5 library from Anaconda (you probably do not have HDF5 installed otherwise on your system?). Due to the way CMake determines the compiler flags to use when linking with HDF5 it might be that a -DNDEBUG comes in from there into HDF5_C_DEFINITIONS, which are applied to the target CompiledNN but not to its consumers. You could verify this by either temporarily turning the PRIVATE in line 198 of CMakeLists.txt to PUBLIC or to check the output of /home/barth/anaconda3/bin/h5cc -show for -DNDEBUG.

Anyway, the solution should be to install libhdf5-dev (or whatever the HDF5 library is called in your system) and rebuild.

from compilednn.

b4rthm avatar b4rthm commented on August 30, 2024

I checked and libhdf5-dev is already installed and the output of /home/barth/anaconda3/bin/h5cc -show contains -DNDEBUG.

Here is the output of the build:
~/Workspace/CompiledNN/_build$ cmake --build .
Scanning dependencies of target CompiledNN
[ 1%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN.cpp.o
[ 2%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/Model.cpp.o
[ 4%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/SimpleNN.cpp.o
[ 5%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/ActivationFunctions.cpp.o
[ 7%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/CompilationSettings.cpp.o
[ 8%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Activation.cpp.o
[ 10%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Arithmetic.cpp.o
[ 11%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/BatchNormalization.cpp.o
[ 12%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Concatenate.cpp.o
[ 14%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Conv2D.cpp.o
[ 15%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Cropping2D.cpp.o
[ 17%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/DConv2D.cpp.o
[ 18%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Dense.cpp.o
[ 20%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/GlobalPooling2D.cpp.o
[ 21%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Im2Col2D.cpp.o
[ 22%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Pooling2D.cpp.o
[ 24%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/Softmax.cpp.o
[ 25%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/UInt8Input.cpp.o
[ 27%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/UpSampling2D.cpp.o
[ 28%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Operations/ZeroPadding2D.cpp.o
[ 30%] Building CXX object CMakeFiles/CompiledNN.dir/Src/CompiledNN/CompiledNN/Util/ExpApprox.cpp.o
[ 31%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/arch.cpp.o
[ 32%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/assembler.cpp.o
[ 34%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/builder.cpp.o
[ 35%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/callconv.cpp.o
[ 37%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/codeholder.cpp.o
[ 38%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/compiler.cpp.o
[ 40%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/constpool.cpp.o
[ 41%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/cpuinfo.cpp.o
[ 42%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/emitter.cpp.o
[ 44%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/func.cpp.o
[ 45%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/globals.cpp.o
[ 47%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/inst.cpp.o
[ 48%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/jitallocator.cpp.o
[ 50%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/jitruntime.cpp.o
[ 51%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/logging.cpp.o
[ 52%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/operand.cpp.o
[ 54%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/osutils.cpp.o
[ 55%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/ralocal.cpp.o
[ 57%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/rapass.cpp.o
[ 58%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/rastack.cpp.o
[ 60%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/string.cpp.o
[ 61%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/support.cpp.o
[ 62%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/target.cpp.o
[ 64%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/type.cpp.o
[ 65%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/virtmem.cpp.o
[ 67%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/zone.cpp.o
[ 68%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/zonehash.cpp.o
[ 70%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/zonelist.cpp.o
[ 71%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/zonestack.cpp.o
[ 72%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/zonetree.cpp.o
[ 74%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/core/zonevector.cpp.o
[ 75%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86assembler.cpp.o
[ 77%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86builder.cpp.o
[ 78%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86callconv.cpp.o
[ 80%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86compiler.cpp.o
[ 81%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86features.cpp.o
[ 82%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86instapi.cpp.o
[ 84%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86instdb.cpp.o
[ 85%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86internal.cpp.o
[ 87%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86logging.cpp.o
[ 88%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86operand.cpp.o
[ 90%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/asmjit/src/asmjit/x86/x86rapass.cpp.o
[ 91%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/B-Human/Platform/BHAssert.cpp.o
[ 92%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/B-Human/Tools/Streams/InOut.cpp.o
[ 94%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/B-Human/Tools/Streams/InStreams.cpp.o
[ 95%] Building CXX object CMakeFiles/CompiledNN.dir/3rdParty/B-Human/Tools/Streams/SimpleMap.cpp.o
[ 97%] Linking CXX static library libCompiledNN.a
[ 97%] Built target CompiledNN
Scanning dependencies of target main
[ 98%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
CMakeFiles/main.dir/main.cpp.o: In function NeuralNetwork::CompiledNN::apply() const': main.cpp:(.text._ZNK13NeuralNetwork10CompiledNN5applyEv[_ZNK13NeuralNetwork10CompiledNN5applyEv]+0x3c): undefined reference to Assert::print(char const*, int, char const*, ...)'
main.cpp:(.text._ZNK13NeuralNetwork10CompiledNN5applyEv[_ZNK13NeuralNetwork10CompiledNN5applyEv]+0x41): undefined reference to `Assert::abort()'
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:90: recipe for target 'main' failed
make[2]: *** [main] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/main.dir/all' failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

from compilednn.

ahasselbring avatar ahasselbring commented on August 30, 2024

So CMake is choosing the Anaconda-HDF5 by default. This can probably be avoided by passing -DHDF5_ROOT=/usr to CMake (-> cmake -DHDF5_ROOT=/usr ..).

from compilednn.

b4rthm avatar b4rthm commented on August 30, 2024

The build finally runs through, that solved the problem.
Thank you very much.

from compilednn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.