-
Notifications
You must be signed in to change notification settings - Fork 103
Set location of Trilinos package and find it #229
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
base: master
Are you sure you want to change the base?
Conversation
|
The current version of CppAD requires the user to set sacado_prefix on the cmake command line in order to include the Sacado tests; see package_prefix on Packages that have been converted to use automatic detection of the prefix location now use a true of false include_package flag; e.g., see include_adolc on In addition, the cmake command should detect if the user is using the old style cmake command and provide an error message for to how fix it. See the comment
Also, the documentation for the cmake command will need to be modified to reflect this change; e.g., see include_adolc in |
The current version of CppAD requires the user to set sacado_prefix on the cmake command line in order to include the Sacado tests; see package_prefix on No, this doesn’t work. Longer answer - In isolation, setting secado_prefix is insufficient. I tried setting secado_prefix by itself. When I did this, the the secado speed test failed because of undefined references due to the fact the Trilinos package was not found. Ensuring this was found required both the following:
|
Packages that have been converted to use automatic detection of the prefix location now use a true of false include_package flag; e.g., see include_adolc on My intention was not to do automatic detection. From the perspective of user friendliness, I agree that would be ideal. However, my goal was simpler. My goal was to ensure all the tests including the secado speed test passed. It’s possible the code change works without the command line argument: -DTrilinos_DIR=$(pwd)/prefix/ I will try without this argument and let you know if it works. Even if it works, it wouldn’t change the code portion of this pull request, but it wouldn’t change the documentation portion. |
In addition, the cmake command should detect if the user is using the old style cmake command and provide an error message for to how fix it. See the comment # Arguments that are no longer used in the file FOREACH(pkg adolc eigen ipopt cppadcg) My goal was not to change the Cmake flags. From the perspective of documentation, I agree that the command line argument -DTrilinos_DIR=$(pwd)/prefix/ should be discussed if it’s necessary. However, this argument may not be required. If it’s not required, then I don’t believe any changes need to be made to this merge request. However, I will edit line 22 in the OP and remove the argument: -DTrilinos_DIR=$(pwd)/prefix/ Let me know if this clarifies and if you agree with my analysis. Thanks |
In the file
Perhaps you know how to fix this setting or the documentation for your case. |
Thanks for your last comment. Now, it's clear. I think we just need to add
after line 47 in the file you linked. Also, I believe the cmake option:
can be removed. I'll test it and update this pull request tomorrow evening or Wednesday. |
Maybe CMAkeLists we should say something somethig about searching cmake_install_libdirs |
Adding
after line 47 is insufficient. However, it is possible to simply modify the file https://github.com/coin-or/CppAD/blob/master/speed/sacado/CMakeLists.txt to get things to work. I was able to add set(Trilinos_DIR "./build/prefix/lib64/cmake/Trilinos") to the CMakeLists.txt for speed/sacado to get things to work. I still need to test:
Once I create and test a clean pull request that respects the style of the build, I'll modify this pull request. I still need to test a couple of things. |
Please test the following changes to the current master branch:
to
|
I tried changing the top level CMakeLists.txt with the suggested change, which was to change the line:
to
Furthermore, I changed the cmake command to
As stated, these changes did not fix the problem. For some reason, the CMakeCache.txt file still reads as follows:
The changes made to the top-level CMakeLists.txt file don't transfer to the generated CMakeCache.txt file. If I manually change the CMakeCache.txt file line above to the following:
then, everything works perfectly. However, it is awkward to change a generated CMakeCache.txt file like this. I would need to do more digging to figure out how to ensure that the line generated in CMakeCache.txt could be generated properly. |
What happens if you remove the old CMakeCache.txt file before running cmake; i.e., is this happening because you have the old settings in CMakeCache.txt and hence it is ignoring the command line arguments. |
I tried deleting CMakeCache.txt. It gets regenerated with only lib and not lib;lib64. However, changing it manually fixes the problem. Furthermore, running bin/cppadcg.sh and running cmake both generate CMakeCache.txt. In both cases, the generated CMakeCache.txt has only lib as opposed to lib;lib64. I haven’t traced the code to determine whether |
Good catch. I think The problem is in cppadcg.sh. It is a kuldge so that I can test how cppad works in the CppADCodeGen context. The problem here is circular dependency because CppADCodeGen depends on CppAD and so must run the CppAD cmake comamnd. Please try removing cppadcg.sh from your testing. |
To add to my previous comment, I tried string escaping the “;”. In other words, I also tried: command_line_arg(cmake_install_libdirs lib\;lib64 STRING That didn’t seem to work either. In the code, I had only one backslash. GitHub is also removing a backslash with its string escaping. |
Thanks for the note about cppadcg.sh. It’s possible we had the right method with some of the ideas discussed above but weren’t able to get a working solution because we got tripped up with cppadcg.sh. I’ll retest all the methods above without cppadcg.sh. Thanks. |
I force pushed a working version. It's basically what you suggested, which was to modify the line
to
However, the string lib;lib64 needs to be in quotes. Otherwise, cmake reads lib;lib64 as lib and inserts into CMakeCache.txt, and we don't get the intended effect. Also, my previous attempt of using "lib\;lib64" didn't work. We need simply "lib;lib64". That works nicely with and without bin/get_cppadcg.sh. CMakeCache.txt has the correct line and all tests build and work properly. Thanks for your help with this. |
Also, I signed the Contributor License Agreement, but it still shows as pending. |
This change is required to ensure that all tests pass when sacado tests are enabled.
On Ubuntu 22.04 LTS, the very last test fails because the Trilinos package is not loaded, which prevents the sacado speed test from building because the required libraries and corresponding symbols are not present. The minor change I added ensures that Trilinos package is found. The following commands can be used to test the last test on the current version fails, but that all tests with the additional tweak I added pass. Here are the commands to reproduce:
Two additional issues not fixed by this pull request:
If this command isn't run, cpp_ipopt_test tends to link against libdmumps_seq-5.4.so causing a conflict between two mumps libraries. Uninstalling the system packages above prevents this conflict.
2. The symlink introduced in step 21 could cause issues for people. I shouldn't have to introduce this additional step. I'm not sure it is required on all operating systems. However, I noticed one of the other open Issues was caused by a Coloring Package failure on FreeBSD. Not sure whether this issue fixes that.
Here's the output of make check showing that the commands above indeed pass all the tests:
https://dpaste.org/AwAt7