Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the test program Jacobian module listwith cppAD library gives a lot of errors #85

Open
qmpotential opened this issue Sep 8, 2023 · 6 comments

Comments

@qmpotential
Copy link

Hey guys,
I need your help! I am new to the library.
Installing the library like
cmake ..
make install
seems working file but when I run the test file I am getting the following.

@qmpotential
Copy link
Author

icpc -o test3.run test3.cpp
/tmp/icpcvNHPT6.o: In function CppAD::vector<double> CppAD::ADFun<double, double>::Forward<CppAD::vector<double> >(unsigned long, CppAD::vector<double> const&, std::ostream&)': test3.cpp:(.text._ZN5CppAD5ADFunIddE7ForwardINS_6vectorIdEEEET_mRKS5_RSo[_ZN5CppAD5ADFunIddE7ForwardINS_6vectorIdEEEET_mRKS5_RSo]+0x1114): undefined reference to CppAD::local::temp_fileabi:cxx11'

@qmpotential
Copy link
Author

My code is
#include
#include <cppad/cppad.hpp>

int main(){

size_t n = 1;
size_t m = 1;

CppAD::vector<CppAD::AD> X(n);
CppAD::vector<CppAD::AD> Y(m);

Y[0] = CppAD::sin(X[0]);

CppAD::ADFun f(X,Y);

CppAD::vector x(n);
CppAD::vector jac(m * n);

x[0] = 0.5;

jac = f.Jacobian(x);

return 0;

}

@bradbell
Copy link
Collaborator

bradbell commented Sep 9, 2023

Perhaps the following discussions will help ?
coin-or/CppAD#173
coin-or/CppAD#175

@qmpotential
Copy link
Author

Good morning, Bradbell!

Thank you so much for your links, they are somewhat helpful, but I still have a question
about the proper installation. I still have trouble to compile my test program with the reference to the CppAD::local::temp_fileabi:cxx11' file.

Do I miss something?

I can see the cppad.hpp file in ../include/cppad/ directory and ../include/cppad/local/temp_file.hpp

Do you have a quick check to find if all the libraries have properly linked ?

Thank you so much in advance.

@bradbell
Copy link
Collaborator

bradbell commented Sep 11, 2023

I suggest that you find where CppADCodeGen has stored its pkg-config file. For example
find dir -name 'cppadcg.pc'
where dir is the prefix for your install of CppADCodeGen.

Let subdir be the sub-directory where the cppadcg.pc file is stored and set
export PKG_CONFIG_PATH=full_path_to_subdir

Then execute the command
pkg-config --libs --cflags cppadcg
and you should get all the flags you need to link CppADCodeGen.

@qmpotential
Copy link
Author

Thank you so much it worked, by the way, there is no cppadcg.pc file,
but cppad.pc file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants