joaoleal / CppADCodeGen

Source Code Generation for Automatic Differentiation using Operator Overloading
Other
162 stars 36 forks source link

make build_tests fails #82

Closed Huzaifg closed 12 months ago

Huzaifg commented 1 year ago

I am trying to do testing for the CppADCodeGen package. I successfully built CppAD and verified the build with make check. I then installed CppADCodeGen using make install and everything worked fine. I can also see the cg folder under usr/local/include/cppad.

However, when I try to run make build_tests I get a weird Dwarf Error. See Error stack here

I also tried compiling the code from the LibGeneration page using g++ -std=c++14 test_cppad.cpp -o test but I get the error /usr/bin/ld: /tmp/cchpMV1l.o: in functionvoid CppAD::put_check_for_nan<CppAD::cg::CG >(CppAD::vector<CppAD::cg::CG > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&)': test_cppad.cpp:(.text._ZN5CppAD17put_check_for_nanINS_2cg2CGIdEEEEvRKNS_6vectorIT_EERNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5CppAD17put_check_for_nanINS_2cg2CGIdEEEEvRKNS_6vectorIT_EERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x70): undefined reference to CppAD::local::temp_file[abi:cxx11]()' collect2: error: ld returned 1 exit status

Any idea what's wrong?

I am running OS: Arch Linux x86_64 Kernel: 6.2.13-arch1-1

Edit: For reference, this is what cmake -DGOOGLETEST_GIT=ON ../CppADCodeGen/ gives me

-- The CXX compiler identification is GNU 9.3.0
-- The C compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/unjhawala/anaconda3/bin/x86_64-conda-linux-gnu-c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/unjhawala/anaconda3/bin/x86_64-conda-linux-gnu-cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
-- Found CppAD: /usr/local/include (Required is at least version "20200000.1") 
-- package CppAD 20230000.0 found
-- Could NOT find ADOLC (missing: ADOLC_INCLUDE_DIRS ADOLC_LIBRARIES) 
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0") 
-- Found DL: /home/unjhawala/anaconda3/x86_64-conda-linux-gnu/sysroot/usr/include  
-- package dl found
-- llvm-config found at: /usr/bin/llvm-config
-- Found LLVM: /usr/include  
-- Found Clang: /usr/include (Required is at least version "15.0.7") 
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found LATEX: /usr/bin/latex   
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.6") found components: doxygen missing components: dot
-- Found Valgrind: /usr/bin/valgrind  
-- Valgrind found
-- Configuring done (2.3s)
-- Generating done (1.4s)
-- Build files have been written to: /home/unjhawala/cppadcsg-tests
Huzaifg commented 12 months ago

Closing this, it was an issue with my arch OS