bradbell / cppad_py

A C++ Object Library and Python Interface to Cppad
https://cppad-py.readthedocs.io
15 stars 3 forks source link

continuation lines in setup.py and parsing in get_cppad.sh don't work #5

Closed utke1 closed 4 years ago

utke1 commented 6 years ago

with the latest version of setup.py having:

swig_cxx_flags = \
"-Wno-sign-compare -Wno-catch-value -Wno-class-memaccess -std=c++11"
#
cppad_cxx_flags = \
"-Wall -pedantic-errors -Wno-unused-result -std=c++11"

the output of bin/get_cppad.sh shows

....
-- cppad_cxx_flags = \

and the compile fails with

Scanning dependencies of target speed_example
[  1%] Building CXX object speed/example/CMakeFiles/speed_example.dir/example.cpp.o
g++: error:  -g: No such file or directory

Even if I remove the newline the parsing in get_cppad.sh I see as

# cppad_cxx_flags
cppad_cxx_flags=`grep '^cppad_cxx_flags *=' setup.py | \
        sed -e 's|.*= *||g' -e 's|"||g' -e "s|'||g"`

still gets a messed ouput because then I see

-- cppad_cxx_flags = c++11
utke1 commented 6 years ago

BTW - I am running "GNU bash, version 4.2.46(2)"

utke1 commented 6 years ago

OK - looking a little bit closer shows that this part of the parsing:

sed -e 's|.*= *||g' 

eats up everything until the "=" character in -std=c++11, hence the result.

utke1 commented 6 years ago

To be sure - I would be OK to compile cppad separately but I am somewhat confused by the seeming coexistence of cmake and autotools artifacts in the cppad repo (and I will readily confess that I don't understand cmake builds well, find it somewhat inscrutable and consequently am not a big fan of it :-) )

bradbell commented 6 years ago

Perhaps a good way to go is to use CMake for testing the C++ library, and setup.py for testing the python library. That way, cmake would not need to get the version of python correctly (which gets very confusing on many systems).

I am currently in the middle of something else for CppAD, but will try to get to this soon.

bradbell commented 6 years ago

I removed the continuation lines in setup.py (and did some other fixing along these lines).

bradbell commented 4 years ago

I have revamped the setup so that setup.py does the building and cmake is only used for testing. If you have problems with this, please re-open this bug.