changes to cmake list to install rol as package#28
Conversation
dridzal
left a comment
There was a problem hiding this comment.
This looks good. Can you add to this PR the change to README.md that goes all the way to make install? Making this change would update the build instructions for our github website. Later, we can copy the instructions to rol.sandia.gov. Also, I am wondering if it would be possible to provide a (very) compact cmake project example that uses ROL, including the cmake file and a ROL::StdVector based example. It could go into Getting Started.
|
Can do - would you want to change make to cmake or ninja? I haven't tested with make install but I would assume it works. Re: cmake project example - I was thinking we put the MFEM example hook-up as well somewhere once that's up and running. But for the simple one, perhaps I can raise an issue and put it in a subsequent PR? |
You can just use make and make install. In your script, you can test it by deleting the line with ninja and just running plain make. Regarding the example, I was hoping that it would be compact enough to include in README.md, but it's ok to raise an issue. |
|
I'm not sure it would be compact enough to include in the "getting started". Would you want a whole example? To me it feels like a whole website section/page. |
Yes, it may be better to have this on rol.sandia.gov. |
GrahamBenHarper
left a comment
There was a problem hiding this comment.
I can confirm this works on Ubuntu with CMake 3.28.3 and gcc 13.3.0 by linking it against a minimal external example.
$ cmake .
-- CMAKE_PREFIX_PATH=
-- ROL_LIB=/home/gbharpe/Programming/cpp/rol/rol-install/lib/librol.so
-- ROL_INCLUDE_DIR=/home/gbharpe/Programming/cpp/rol/rol-install/include
-- Configuring done (0.0s)
-- Generating done (0.1s)
-- Build files have been written to: /home/gbharpe/Programming/cpp/rol/rol-examples
$ make
[ 50%] Linking CXX executable main
[100%] Built target main
$ ./main
Hello from ROL
$ cat main.cpp
#include <iostream>
#include "ROL_Ptr.hpp"
int main() {
ROL::Ptr<int> p;
std::cout << "Hello from ROL" << std::endl;
}
|
We should also include the cmake example. |
initial build changes for parameterlist cpp circular reference
GrahamBenHarper
left a comment
There was a problem hiding this comment.
ROL_config.h is only created in the build directory but not the install directory, so we need to make sure that also gets copied into the install directory
GrahamBenHarper
left a comment
There was a problem hiding this comment.
These should fix one problem, but I still see those Teuchos linker errors, which might be a little more tricky
Co-authored-by: Graham Harper <GrahamBenHarper@users.noreply.github.com>
GrahamBenHarper
left a comment
There was a problem hiding this comment.
That looks good! I've tested that setup and it works for me.
|
@dridzal - this is ready to go, but the building ROL as a part of Trilinos test failed. I ran this test on develop to check if it was this branch or not, but that also failed. Do you know the reason? |
Modified the cmake file to allow for rol to be built as a package.