Skip to content

Commit

Permalink
bare metal build seems to be working
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Hughes authored and stonecoldhughes committed Jan 17, 2024
1 parent e5d8416 commit 909222f
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 43 deletions.
56 changes: 51 additions & 5 deletions CMake/filepaths_default.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,70 @@
# default filepath locations for installed dependency files

set( NETCDF_CXX_SHARED_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )
if( NOT DEFINED NETCDF_CXX_SHARED_LIB_DIR )

set( NETCDF_CXX_SHARED_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )
else()

set( NETCDF_CXX_SHARED_LIB_DIR ${NETCDF_CXX_SHARED_LIB_DIR}
CACHE STRING "${description}" )
endif()

if( NOT DEFINED NETCDF_CXX_HEADERS_DIR )

set( NETCDF_CXX_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "empty" )
set( NETCDF_CXX_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )
else()

set( NETCDF_CXX_HEADERS_DIR ${NETCDF_CXX_HEADERS_DIR}
CACHE STRING "${description}" )
endif()

if( NOT DEFINED NETCDF_C_SHARED_LIB_DIR )

set( NETCDF_C_SHARED_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )

else()

set( NETCDF_C_SHARED_LIB_DIR ${NETCDF_C_SHARED_LIB_DIR}
CACHE STRING "${description}" )

endif()

if( NOT DEFINED NETCDF_C_HEADERS_DIR )
set( NETCDF_C_HEADERS_DIR "/usr/include" CACHE STRING "${description}" )
else()
set( NETCDF_C_HEADERS_DIR ${NETCDF_C_HEADERS_DIR} CACHE STRING "${description}" )
endif()

if( NOT DEFINED ${LIBCONFIG_CXX_LIB_DIR})
set( LIBCONFIG_CXX_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )
else()
set( LIBCONFIG_CXX_LIB_DIR ${LIBCONFIG_CXX_LIB_DIR}
CACHE STRING "${description}" )
endif()

if( NOT DEFINED ${LIBCONFIG_C_LIB_DIR} )
set( LIBCONFIG_C_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )
else()
set( LIBCONFIG_C_LIB_DIR ${LIBCONFIG_C_LIB_DIR}
CACHE STRING "${description}" )
endif()

if( NOT DEFINED ${LIBCONFIG_CXX_HEADERS_DIR} )
set( LIBCONFIG_CXX_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )

else()
set( LIBCONFIG_CXX_HEADERS_DIR ${LIBCONFIG_CXX_HEADERS_DIR}
CACHE STRING "${description}" )
endif()
if( NOT DEFINED ${LIBCONFIG_C_HEADERS_DIR} )
set( LIBCONFIG_C_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib"
CACHE STRING "${description}" )
else()
set( LIBCONFIG_C_HEADERS_DIR ${LIBCONFIG_C_HEADERS_DIR}
CACHE STRING "${description}" )
endif()
6 changes: 4 additions & 2 deletions CMake/netcdf.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# find files

# Captain! Find file:
find_file( netcdf_cxx_shared_lib
NAMES libnetcdf-cxx4.so libnetcdf_c++4.so
HINTS ${NETCDF_CXX_SHARED_LIB_DIR} )

message( "Captain! netcdf_c_shared_lib: ${netcdf_c_shared_lib}" )

message( "Captain! netcdf_c_shared_lib dir: ${NETCDF_C_SHARED_LIB_DIR}" )

find_file( netcdf_c_shared_lib
NAMES libnetcdf.so
Expand All @@ -17,7 +20,6 @@ find_path( netcdf_cxx_headers
NAMES netcdf
HINTS ${NETCDF_CXX_HEADERS_DIR} )

message( "netcdf_c_shared_lib: ${netcdf_c_shared_lib}" )
add_library( netcdf_cxx SHARED IMPORTED )
add_library( netcdf_c SHARED IMPORTED )

Expand Down
16 changes: 8 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake -S $1 -B $2 -G Ninja \
-D NETCDF_C_HEADERS_DIR="/home/5n4/workshop/tree/external/netcdf-c-install/include" \
-D NETCDF_CXX_HEADERS_DIR="/home/5n4/workshop/tree/external/netcdf-cxx4-install/include" \
-D NETCDF_C_SHARED_LIB_DIR="/home/5n4/workshop/tree/external/netcdf-c-install/lib" \
-D NETCDF_CXX_SHARED_LIB_DIR="/home/5n4/workshop/tree/external/netcdf-cxx4-install/lib" \
-D LIBCONFIG_C_HEADERS_DIR="/home/5n4/workshop/tree/external/libconfig_install/include" \
-D LIBCONFIG_CXX_HEADERS_DIR="/home/5n4/workshop/tree/external/libconfig_install/include" \
-D LIBCONFIG_C_LIB_DIR="/home/5n4/workshop/tree/external/libconfig_install/lib" \
-D LIBCONFIG_CXX_LIB_DIR="/home/5n4/workshop/tree/external/libconfig_install/lib" \
-DNETCDF_C_HEADERS_DIR="/home/5n4/build_right/external/netcdf-c-install/include" \
-DNETCDF_CXX_HEADERS_DIR="/home/5n4/build_right/external/netcdf-cxx4-install/include" \
-DNETCDF_C_SHARED_LIB_DIR="/home/5n4/build_right/external/netcdf-c-install/lib" \
-DNETCDF_CXX_SHARED_LIB_DIR="/home/5n4/build_right/external/netcdf-cxx4-install/lib" \
-DLIBCONFIG_C_HEADERS_DIR="/home/5n4/build_right/external/libconfig_install/include" \
-DLIBCONFIG_CXX_HEADERS_DIR="/home/5n4/build_right/external/libconfig_install/include" \
-DLIBCONFIG_C_LIB_DIR="/home/5n4/build_right/external/libconfig_install/lib" \
-DLIBCONFIG_CXX_LIB_DIR="/home/5n4/build_right/external/libconfig_install/lib" \
&> $2/cmake_output.txt ;

cmake --build $2 -- -j 0 &> $2/build_output.txt
2 changes: 0 additions & 2 deletions build/clean.sh

This file was deleted.

26 changes: 0 additions & 26 deletions build/make_gitr.sh

This file was deleted.

0 comments on commit 909222f

Please sign in to comment.