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

CMake build needs to require sp library #27

Closed
edwardhartnett opened this issue Sep 30, 2020 · 6 comments · Fixed by #28
Closed

CMake build needs to require sp library #27

edwardhartnett opened this issue Sep 30, 2020 · 6 comments · Fixed by #28

Comments

@edwardhartnett
Copy link
Contributor

In the workflow we have:

    - name: checkout-sp
      uses: actions/checkout@v2
      with:
        repository: NOAA-EMC/NCEPLIBS-sp
        path: sp
        ref: develop

    - name: build-sp
      run: |
        cd sp
        mkdir build
        cd build
        cmake .. -DCMAKE_INSTALL_PREFIX=~/sp
        make -j2
        make install


Yet CMakeLists.txt does not check for sp, and it is not needed to build ip.

@kgerheiser
Copy link
Contributor

The thing is that none of these libraries have interfaces and they are built statically so even though it does use sp it's not enforced at compile time.

@edwardhartnett
Copy link
Contributor Author

OK, so then the bug here is that the ip CMakeLists.txt file does not require sp, but should.

@edwardhartnett edwardhartnett changed the title The sp library is built in the GitHub workflow, but does not seem to be needed by ip CMake build needs to require sp library Sep 30, 2020
@edwardhartnett
Copy link
Contributor Author

OK, actually the sp library is required in the CMake build, but only if tests are run. Here's the tests/CMakeLists.txt file:

#list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")

file(COPY data/ DESTINATION data)

find_package(sp REQUIRED)

add_pfunit_ctest (interp_test
  TEST_SOURCES test_mod.pf
  LINK_LIBRARIES ip::ip_4 sp::sp_4
)

Is sp only needed for testing?

@kgerheiser
Copy link
Contributor

kgerheiser commented Sep 30, 2020

SP is needed to create an executable that uses ip because of the aforementioned interface/static library thing. It should be found at compile time even if it's currently not used.

@edwardhartnett
Copy link
Contributor Author

OK, understood. In that case this should be checked at the top level CMakeLists.txt file.

When you execute #226, then sp will be needed for make all as well as make tests, because the interface will allow fortran to check for sp at compile time. (I believe...)

@kgerheiser
Copy link
Contributor

That is correct

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

Successfully merging a pull request may close this issue.

2 participants