Skip to content

Commit

Permalink
changed how voxelizer builds
Browse files Browse the repository at this point in the history
  • Loading branch information
djdunning committed Dec 19, 2024
1 parent ff697b7 commit 5c660fe
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
18 changes: 16 additions & 2 deletions .conda/voxelizer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@
source "$RECIPE_DIR/../cross-compile-setup.sh"
export CMAKE_CXX_FLAGS=$PATCHED_CXXFLAGS

cd src/Voxelizer
# Use the --prefix flag here because we are
# not using the *host* python to do this. We are (against Anaconda's recommendations)
# using the *build* python here, since we actually need to do cross compilation
# not really sure how to do the cross compilation with python.
pip install --prefix=$PREFIX
###DANpip install --prefix=$PREFIX

cd src/Voxelizer
mkdir -p build
cd build
cmake .. \
-D CMAKE_BUILD_TYPE:STRING=RELEASE \
-D CMAKE_INSTALL_PREFIX:PATH=$PREFIX \
-D CMAKE_CXX_STANDARD:STRING=17 \
-D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \
-D STANDALONE_VOXELIZER=ON \
$CMAKE_ARGS \
$SRC_DIR \
-D CMAKE_CXX_FLAGS="$PATCHED_CXXFLAGS" \

make install
15 changes: 8 additions & 7 deletions .conda/voxelizer/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ requirements:
- cmake >=3.17.0
- {{ compiler('cxx') }}={{ linux_compiler_version }} # [linux]
- {{ compiler('cxx') }}={{ macos_compiler_version }} # [osx]
- python={{ python }}
- pybind11
- setuptools
- elements
#- python={{ python }}
#- pybind11
#- setuptools
host:
- python={{ python }}
#- python={{ python }}
- elements
- llvm-openmp
- llvm-openmp # [osx]
run:
- python={{ python }}
- llvm-openmp
#- python={{ python }}
#- llvm-openmp # [osx]

test:
imports:
Expand Down
8 changes: 5 additions & 3 deletions src/Voxelizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set(CMAKE_CXX_STANDARD 17)
#find_package(Kokkos REQUIRED)
#find_package(Matar REQUIRED)
find_package(Elements REQUIRED)

if (NOT STANDALONE_VOXELIZER)
find_package(MPI REQUIRED)

# Assume if the CXX compiler exists, the rest do too.
Expand All @@ -21,6 +23,9 @@ if(NOT DISTRIBUTION)
set(CMAKE_C_FLAGS "${Trilinos_C_COMPILER_FLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_Fortran_FLAGS "${Trilinos_Fortran_COMPILER_FLAGS} ${CMAKE_Fortran_FLAGS}")
endif()
include_directories(${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS})
link_directories(${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})
endif() # end non-standalone

#add_definitions(-DHAVE_KOKKOS=1)

Expand All @@ -29,9 +34,6 @@ target_include_directories(voxelizer PUBLIC include)
#target_link_libraries(voxelizer matar Kokkos::kokkos)
target_link_libraries(voxelizer Elements)

include_directories(${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS})
link_directories(${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS})

add_executable(fierro-voxelizer src/main.cpp)
target_link_libraries(fierro-voxelizer voxelizer)
#target_compile_options(fierro-voxelizer PRIVATE "-fopenmp")
Expand Down

0 comments on commit 5c660fe

Please sign in to comment.