diff --git a/.codecov.yml b/.codecov.yml index a3d94ccef..400c3ab84 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -19,9 +19,10 @@ ignore: - scripts - include/occa/scripts # Auto-generated files - - include/occa/core/kernelOperators.hpp_codegen - - src/core/kernelOperators.cpp_codegen - - src/occa/internal/utils/runFunction.cpp_codegen + - include/codegen/kernelOperators.cpp_codegen + - include/codegen/kernelOperators.hpp_codegen + - include/codegen/macros.hpp_codegen + - include/codegen/runFunction.cpp_codegen # Exception is not tracked properly - src/utils/exception.cpp # Modes that can't be tested with CI diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5884add6c..0fce65efd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,9 @@ jobs: uses: mxschmitt/action-tmate@v3.13 if: ${{ inputs.debug_enabled }} + - name: Set OCCA install directory + run: echo "OCCA_INSTALL_DIR=${PWD}/install" >> ${GITHUB_ENV} + - name: add oneAPI to apt if: ${{ matrix.useoneAPI }} shell: bash @@ -104,14 +107,14 @@ jobs: - name: Compiler info if: ${{ !matrix.useCMake }} - run: make -j 16 info + run: make PREFIX=${{ env.OCCA_INSTALL_DIR }} -j 16 info - name: CMake configure if: ${{ matrix.useCMake && !matrix.useoneAPI}} run: | cmake -S . -B build \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DCMAKE_INSTALL_PREFIX=install \ + -DCMAKE_INSTALL_PREFIX=${{ env.OCCA_INSTALL_DIR }} \ -DCMAKE_C_COMPILER=${CC} \ -DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_Fortran_COMPILER=${FC} \ @@ -128,7 +131,7 @@ jobs: source /opt/intel/oneapi/setvars.sh cmake -S . -B build \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DCMAKE_INSTALL_PREFIX=install \ + -DCMAKE_INSTALL_PREFIX=${{ env.OCCA_INSTALL_DIR }} \ -DCMAKE_C_COMPILER=${CC} \ -DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_Fortran_COMPILER=${FC} \ @@ -136,21 +139,21 @@ jobs: -DOCCA_ENABLE_EXAMPLES=ON \ -DOCCA_ENABLE_FORTRAN=${OCCA_FORTRAN_ENABLED} - - name: CMake build + - name: CMake build and install if: ${{ matrix.useCMake && !matrix.useoneAPI}} run: | - cmake --build build --parallel 16 + cmake --build build --target install --parallel 16 - - name: CMake build + - name: CMake build and install if: ${{ matrix.useCMake && matrix.useoneAPI}} env: OCCA_CC: ${{ matrix.CC }} OCCA_CXX: ${{ matrix.CXX }} run: | source /opt/intel/oneapi/setvars.sh - cmake --build build --parallel 16 + cmake --build build --target install --parallel 16 - - name: Compile library + - name: Compile library and install if: ${{ !matrix.useCMake }} run: make -j 16 diff --git a/.gitignore b/.gitignore index 7bcc9ce65..252dffe86 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,10 @@ opt /.compiledDefines /include/occa/defines/compiledDefines.hpp /include/occa/scripts -/include/occa/core/kernelOperators.hpp_codegen -/src/core/kernelOperators.cpp_codegen -/src/occa/internal/utils/runFunction.cpp_codegen -/include/occa/defines/macros.hpp_codegen +/include/codegen/kernelOperators.cpp_codegen +/include/codegen/kernelOperators.hpp_codegen +/include/codegen/macros.hpp_codegen +/include/codegen/runFunction.cpp_codegen # Binaries generated to fetch compiler information /scripts/compiler/compilerSupportsMPI diff --git a/Makefile b/Makefile index d2ae06869..994437d44 100644 --- a/Makefile +++ b/Makefile @@ -80,14 +80,14 @@ else endif #================================================= -PLACE_GENERATED_CODES := $(shell mkdir -p $(OCCA_DIR)/include/occa/core/codegen | \ +PLACE_GENERATED_CODES := $(shell mkdir -p $(OCCA_DIR)/include/codegen | \ mkdir -p $(OCCA_DIR)/src/core/codegen | \ mkdir -p $(OCCA_DIR)/src/occa/internal/utils/codegen | \ mkdir -p $(OCCA_DIR)/include/occa/defines/codegen) -PLACE_GENERATED_CODES := $(shell cp $(OCCA_DIR)/scripts/codegen/kernelOperators.hpp_codegen.in $(OCCA_DIR)/include/occa/core/codegen/kernelOperators.hpp_codegen | \ - cp $(OCCA_DIR)/scripts/codegen/kernelOperators.cpp_codegen.in $(OCCA_DIR)/src/core/codegen/kernelOperators.cpp_codegen | \ - cp $(OCCA_DIR)/scripts/codegen/runFunction.cpp_codegen.in $(OCCA_DIR)/src/occa/internal/utils/codegen/runFunction.cpp_codegen | \ - cp $(OCCA_DIR)/scripts/codegen/macros.hpp_codegen.in $(OCCA_DIR)/include/occa/defines/codegen/macros.hpp_codegen) +PLACE_GENERATED_CODES := $(shell cp $(OCCA_DIR)/scripts/codegen/kernelOperators.cpp_codegen.in $(OCCA_DIR)/include/codegen/kernelOperators.cpp_codegen | \ + cp $(OCCA_DIR)/scripts/codegen/kernelOperators.hpp_codegen.in $(OCCA_DIR)/include/codegen/kernelOperators.hpp_codegen | \ + cp $(OCCA_DIR)/scripts/codegen/macros.hpp_codegen.in $(OCCA_DIR)/include/codegen/macros.hpp_codegen | \ + cp $(OCCA_DIR)/scripts/codegen/runFunction.cpp_codegen.in $(OCCA_DIR)/include/codegen/runFunction.cpp_codegen) #---[ Compile Library ]--------------------------- # Setup compiled defines and force rebuild if defines changed diff --git a/cmake/CodeGen.cmake b/cmake/CodeGen.cmake index a771fc55b..95bc9bb45 100644 --- a/cmake/CodeGen.cmake +++ b/cmake/CodeGen.cmake @@ -28,10 +28,16 @@ else() endif() endif() -# Set installtion of files required in header +# Set installtion of files required in header install( - FILES ${OCCA_BUILD_DIR}/include/codegen/kernelOperators.hpp_codegen - DESTINATION include/occa/core/codegen) + FILES ${OCCA_BUILD_DIR}/include/codegen/kernelOperators.cpp_codegen + DESTINATION include/codegen) +install( + FILES ${OCCA_BUILD_DIR}/include/codegen/kernelOperators.hpp_codegen + DESTINATION include/codegen) install( FILES ${OCCA_BUILD_DIR}/include/codegen/macros.hpp_codegen - DESTINATION include/occa/defines/codegen) + DESTINATION include/codegen) +install( + FILES ${OCCA_BUILD_DIR}/include/codegen/runFunction.cpp_codegen + DESTINATION include/codegen) diff --git a/include/occa.hpp b/include/occa.hpp index bed222794..ff41c76cc 100644 --- a/include/occa.hpp +++ b/include/occa.hpp @@ -7,5 +7,6 @@ #include #include #include +#include #endif