Skip to content

Commit

Permalink
Fix build issues for the rebased branch
Browse files Browse the repository at this point in the history
 - fix bad merges
 - remove custom llvm version, use brew with llvm@13
 - follow hpc/gitlab-pipelines changes from Olli
 - load extra module llvm using SPACK_EXTRA_MODULES
 - use gcc build instead of nvhpc which fails to compile with llvm
   headers
  • Loading branch information
pramodk committed Mar 9, 2022
1 parent ff5430c commit c80a44d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
18 changes: 10 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
Expand All @@ -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"
Expand All @@ -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:
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 1 addition & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/codegen/codegen_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ enum BlockType {
/// initial block
Initial,

/// constructor block
Constructor,

/// destructor block
Destructor,

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/codegen/llvm/codegen_llvm_helper_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c80a44d

Please sign in to comment.