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 error for latest ngen master branch #449

Closed
jduckerOWP opened this issue Sep 30, 2022 · 2 comments · Fixed by #487
Closed

Cmake build error for latest ngen master branch #449

jduckerOWP opened this issue Sep 30, 2022 · 2 comments · Fixed by #487
Assignees

Comments

@jduckerOWP
Copy link

jduckerOWP commented Sep 30, 2022

Steps to replicate behavior (include URLs)

I've downloaded latest ngen master branch yesterday and attempted to use CMake on APD-Dev1 cluster to build ngen source code. I've been able to create the MakeFiles using the proper libraries needed to build Fortran. The CMake output for the first step "cmake ." output is below to illustrate libraries linked on APD-Dev1 cluster:

-- Compiler: /opt/rh/devtoolset-6/root/usr/bin/cc
-- Compiler: /opt/rh/devtoolset-6/root/usr/bin/g++
-- Found Boost: /home/jason.ducker/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found suitable version "1.73.0", minimum required is "1.72.0")
INFO UDUNITS_ACTIVE not defined
Looking for UDUNITS-2...
INFO Using UDUNITS2 at /usr/lib64/libudunits2.so and /usr/include/udunits2
INFO NGEN_ACTIVATE_PYTHON not defined
-- Found Python: /home/jason.ducker/anaconda3/bin/python3.9 (found suitable version "3.9.12", minimum required is "3.6.8") found components: Interpreter Development NumPy
-- pybind11 v2.6.1 dev1
-- Found Boost: /home/jason.ducker/anaconda3/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found version "1.73.0")
-- Found Python: /home/jason.ducker/anaconda3/bin/python3.9 (found version "3.9.12") found components: Interpreter
-- Configuring done
-- Generating done

  1. Once configuration is complete, I execute "cmake --build ." and just leave all the default options to full build the ngen libraries. The ngen libraries build properly all the way until [ 96%] Building CXX object test/CMakeFiles/test_bmi_multi.dir/realizations/catchments/Bmi_Multi_Formulation_Test.cpp.o

  2. The following errors are thrown below when Bmi_Multi_Formulation_Test.cpp is being compiled:

/home/jason.ducker/forcing_test/ngen/test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp:810:46: error: ‘Bmi_Fortran_Formulation’ was not declared in this scope
ASSERT_EQ(get_friend_nested_catchment_id<Bmi_Fortran_Formulation>(formulation, 0), "cat-27");
^
/home/jason.ducker/forcing_test/ngen/test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp:810:85: error: no matching function for call to ‘Bmi_Multi_Formulation_Test_GetIdAndCatchmentId_Test::get_friend_nested_catchment_id(realization::Bmi_Multi_Formulation&, int)’
ASSERT_EQ(get_friend_nested_catchment_id<Bmi_Fortran_Formulation>(formulation, 0), "cat-27");
^
/home/jason.ducker/forcing_test/ngen/test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp:71:24: note: candidate: template static std::string Bmi_Multi_Formulation_Test::get_friend_nested_catchment_id(const realization::Bmi_Multi_Formulation&, int)
static std::string get_friend_nested_catchment_id(const Bmi_Multi_Formulation& formulation, const int mod_index) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jason.ducker/forcing_test/ngen/test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp:71:24: note: template argument deduction/substitution failed:
In file included from /home/jason.ducker/forcing_test/ngen/test/googletest/googletest/include/gtest/gtest.h:387:0,
from /home/jason.ducker/forcing_test/ngen/test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp:12:
/home/jason.ducker/forcing_test/ngen/test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp:810:85: error: template argument 1 is invalid
ASSERT_EQ(get_friend_nested_catchment_id<Bmi_Fortran_Formulation>(formulation, 0), "cat-27");

Nels has mentioned that there may be a macro guard missing somewhere. The default cmake build was with Fortran BMI support -DBMI_FORTRAN_ACTIVE=1. Currently, the default cmake build will throw this error.

@mattw-nws
Copy link
Contributor

There may be something here... Checking the "blame" view, the guards added in 44e0bce should probably also have been added in 13dcd18 .

https://github.com/NOAA-OWP/ngen/blame/4c2779f347ac3fc6bffa3cac2f1739d027b52d83/test/realizations/catchments/Bmi_Multi_Formulation_Test.cpp

stcui007 added a commit to stcui007/ngen that referenced this issue Dec 23, 2022
mattw-nws pushed a commit that referenced this issue Jan 4, 2023
@mattw-nws mattw-nws linked a pull request Jan 4, 2023 that will close this issue
6 tasks
@mattw-nws
Copy link
Contributor

Closed in #487

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.

3 participants