diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a445db62d2..a17a8dea9e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,10 +8,6 @@ include: trigger cvf: stage: .pre - variables: - # Tell the CVF pipeline to use the current ref of NMODL, this works because - # the CVF CI uses the `gitlab-pipelines` helper components. - SPACK_PACKAGE_REF_nmodl: "commit='${CI_COMMIT_SHA}'" rules: # Don't run on PRs targeting the LLVM development branch - if: '$CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "llvm"' @@ -22,15 +18,21 @@ trigger cvf: project: hpc/cvf # Make the NMODL CI status depend on the CVF CI status strategy: depend + variables: + # Tell CVF to use the same commits/branches as NMODL. + SPACK_ENV_FILE_URL: $SPACK_SETUP_COMMIT_MAPPING_URL .spack_nmodl: variables: SPACK_PACKAGE: nmodl SPACK_PACKAGE_SPEC: ~legacy-unit+python + SPACK_EXTRA_MODULES: llvm + SPACK_INSTALL_EXTRA_FLAGS: -v spack_setup: extends: .spack_setup_ccache variables: + NMODL_COMMIT: ${CI_COMMIT_SHA} # Enable fetching GitHub PR descriptions and parsing them to find out what # branches to build of other projects. PARSE_GITHUB_PR_DESCRIPTIONS: "true" @@ -42,12 +44,12 @@ build:intel: variables: SPACK_PACKAGE_COMPILER: intel -build:nvhpc: +build:gcc: extends: - .spack_build - .spack_nmodl variables: - SPACK_PACKAGE_COMPILER: nvhpc + SPACK_PACKAGE_COMPILER: gcc SPACK_PACKAGE_DEPENDENCIES: ^bison%gcc^flex%gcc^py-jinja2%gcc^py-sympy%gcc^py-pyyaml%gcc .nmodl_tests: @@ -61,8 +63,8 @@ test:intel: - .nmodl_tests needs: ["build:intel"] -test:nvhpc: +test:gcc: extends: - .ctest - .nmodl_tests - needs: ["build:nvhpc"] + needs: ["build:gcc"] diff --git a/CMakeLists.txt b/CMakeLists.txt index cacf9443ff..28d93e8bfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,7 +158,7 @@ nmodl_find_python_module(yaml 3.12 REQUIRED) # Find LLVM dependencies # ============================================================================= if(NMODL_ENABLE_LLVM) - include(LLVMHelper) + include(cmake/LLVMHelper.cmake) include_directories(${LLVM_INCLUDE_DIRS}) add_definitions(-DNMODL_LLVM_BACKEND) endif() diff --git a/azure-pipelines.yml b/azure-pipelines.yml index df317598b8..14931a0a9a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -132,15 +132,11 @@ jobs: python3 -m pip install --upgrade pip 'setuptools<59.7.0' python3 -m pip install --user 'Jinja2>=2.9.3' 'PyYAML>=3.13' pytest pytest-cov numpy 'sympy>=1.3,<1.9' displayName: 'Install Dependencies' - - script: | - cd $HOME - git clone --depth 1 https://github.com/pramodk/llvm-nightly.git - displayName: 'Setup LLVM v13' - script: | export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH; mkdir -p $(Build.Repository.LocalPath)/build cd $(Build.Repository.LocalPath)/build - cmake .. -DPYTHON_EXECUTABLE=$(which python3) -DCMAKE_INSTALL_PREFIX=$HOME/nmodl -DCMAKE_BUILD_TYPE=RelWithDebInfo -DNMODL_ENABLE_PYTHON_BINDINGS=OFF -DLLVM_DIR=$HOME/llvm-nightly/0621/osx/lib/cmake/llvm -DNMODL_ENABLE_LLVM=ON + cmake .. -DPYTHON_EXECUTABLE=$(which python3) -DCMAKE_INSTALL_PREFIX=$HOME/nmodl -DCMAKE_BUILD_TYPE=RelWithDebInfo -DNMODL_ENABLE_PYTHON_BINDINGS=OFF -DLLVM_DIR=$(brew --prefix llvm)/lib/cmake/llvm -DNMODL_ENABLE_LLVM=ON make -j 2 if [ $? -ne 0 ] then diff --git a/src/codegen/codegen_info.hpp b/src/codegen/codegen_info.hpp index 17e4102700..70940e7428 100644 --- a/src/codegen/codegen_info.hpp +++ b/src/codegen/codegen_info.hpp @@ -196,6 +196,9 @@ enum BlockType { /// initial block Initial, + /// constructor block + Constructor, + /// destructor block Destructor, @@ -214,10 +217,14 @@ enum BlockType { /// net_receive block NetReceive, + /// before / after block + BeforeAfter, + /// fake ending block type for loops on the enums. Keep it at the end BlockTypeEnd }; + /** * \class ShadowUseStatement * \brief Represents ion write statement during code generation diff --git a/src/codegen/llvm/codegen_llvm_helper_visitor.hpp b/src/codegen/llvm/codegen_llvm_helper_visitor.hpp index 9d79e24803..9b3f759bfa 100644 --- a/src/codegen/llvm/codegen_llvm_helper_visitor.hpp +++ b/src/codegen/llvm/codegen_llvm_helper_visitor.hpp @@ -18,6 +18,7 @@ #include "codegen/codegen_info.hpp" #include "symtab/symbol_table.hpp" #include "visitors/ast_visitor.hpp" + #include "utils/logger.hpp" namespace nmodl { namespace codegen {