Skip to content

Commit 94fe3d6

Browse files
subhacomhrani
andauthored
Build updates (#474)
commit b38b6af Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 12:29:49 2024 +0530 Reverted windows build attempts. commit 4c60035 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:52:46 2024 +0530 Updated workflow commit 95febb9 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:51:56 2024 +0530 Updated wortkflow commit 5042502 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:34:03 2024 +0530 Updated workflow file. commit ac6ba27 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:27:33 2024 +0530 Update workflow commit 5ae39a9 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:25:11 2024 +0530 Updated workflow commit b62cf5d Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:15:22 2024 +0530 Update workflow commit be7132e Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:13:35 2024 +0530 Updated build commit e7e2925 Author: subhacom <[email protected]> Date: Tue Apr 23 11:08:39 2024 +0530 Update pymoose.yml commit cc6bce8 Author: subhacom <[email protected]> Date: Tue Apr 23 11:07:10 2024 +0530 Update pymoose.yml commit 28eadbf Author: subhacom <[email protected]> Date: Tue Apr 23 11:05:46 2024 +0530 Update pymoose.yml commit e9ae785 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:00:15 2024 +0530 github workflow msvc/gsl commit 6aba825 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:58:51 2024 +0530 github workflow: msvc/gsl build commit 31617f5 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:52:46 2024 +0530 github workflow: windows GSL build test commit 8ac5de1 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:48:32 2024 +0530 github workflow: windows build of GSL commit 96b9583 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:46:55 2024 +0530 github workflow: Testing GSL build for windows commit 60363ec Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 00:17:23 2024 +0530 Bumped up cmake version to 3.20 - Also trying to install GSL via vcpkg for WIN32 commit e475389 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 00:00:53 2024 +0530 Fixed github workflow file commit 7169d23 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:59:36 2024 +0530 Trying to fix win build commit a80fd8e Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:56:49 2024 +0530 Fixing github workflow for WIN/MSVC build commit a9909bf Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:41:53 2024 +0530 Switched from C++11 to C++14 - MSVC 2015 and later do not support c++11 - causing build to fail commit ae43694 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:25:34 2024 +0530 Github workflow update for windows build - C++11 support check does not work for MSVC cl. Trying a fix. commit a3fe008 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:08:16 2024 +0530 Github workflow for windows build: fixing micromamba options commit b22e200 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:04:26 2024 +0530 Fixing windows build workflow: micromamba path commit f68e4b0 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:01:09 2024 +0530 Attempt fixing micromamba for windows build commit fd99794 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:58:19 2024 +0530 Added windows build action to guthub workflow commit 5b458d8 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:43:01 2024 +0530 Fix to github workflow for build commit 401bd27 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:40:32 2024 +0530 Further fix to build commit 0d7d2aa Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:25:34 2024 +0530 Further fix to micromamba commit b88d231 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:23:14 2024 +0530 Further fix to micromamba command commit 1401e35 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:21:03 2024 +0530 Fixed micromamba commands commit 7cc0289 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:16:23 2024 +0530 Fix for github action commit 2c4c4ed Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:07:29 2024 +0530 Attempting github action to build for both Ubuntu and MacOSX M1 commit d91ca02 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 21:20:26 2024 +0530 Build updated - Removed deprecated CMake version setting - Removed python2: out of life. Only supporting Python>=3.8 - Removed pybind11: should be installed directly with pip - Added MacOSX build workflow: to be tested * Modified test script for Granule98 to take model dir arg * Fixed github workflow to build on Ubuntu and MacOSX Squashed commit of the following: commit b38b6af Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 12:29:49 2024 +0530 Reverted windows build attempts. commit 4c60035 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:52:46 2024 +0530 Updated workflow commit 95febb9 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:51:56 2024 +0530 Updated wortkflow commit 5042502 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:34:03 2024 +0530 Updated workflow file. commit ac6ba27 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:27:33 2024 +0530 Update workflow commit 5ae39a9 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:25:11 2024 +0530 Updated workflow commit b62cf5d Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:15:22 2024 +0530 Update workflow commit be7132e Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:13:35 2024 +0530 Updated build commit e7e2925 Author: subhacom <[email protected]> Date: Tue Apr 23 11:08:39 2024 +0530 Update pymoose.yml commit cc6bce8 Author: subhacom <[email protected]> Date: Tue Apr 23 11:07:10 2024 +0530 Update pymoose.yml commit 28eadbf Author: subhacom <[email protected]> Date: Tue Apr 23 11:05:46 2024 +0530 Update pymoose.yml commit e9ae785 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 11:00:15 2024 +0530 github workflow msvc/gsl commit 6aba825 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:58:51 2024 +0530 github workflow: msvc/gsl build commit 31617f5 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:52:46 2024 +0530 github workflow: windows GSL build test commit 8ac5de1 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:48:32 2024 +0530 github workflow: windows build of GSL commit 96b9583 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 10:46:55 2024 +0530 github workflow: Testing GSL build for windows commit 60363ec Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 00:17:23 2024 +0530 Bumped up cmake version to 3.20 - Also trying to install GSL via vcpkg for WIN32 commit e475389 Author: Subhasis Ray <[email protected]> Date: Tue Apr 23 00:00:53 2024 +0530 Fixed github workflow file commit 7169d23 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:59:36 2024 +0530 Trying to fix win build commit a80fd8e Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:56:49 2024 +0530 Fixing github workflow for WIN/MSVC build commit a9909bf Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:41:53 2024 +0530 Switched from C++11 to C++14 - MSVC 2015 and later do not support c++11 - causing build to fail commit ae43694 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:25:34 2024 +0530 Github workflow update for windows build - C++11 support check does not work for MSVC cl. Trying a fix. commit a3fe008 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:08:16 2024 +0530 Github workflow for windows build: fixing micromamba options commit b22e200 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:04:26 2024 +0530 Fixing windows build workflow: micromamba path commit f68e4b0 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 23:01:09 2024 +0530 Attempt fixing micromamba for windows build commit fd99794 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:58:19 2024 +0530 Added windows build action to guthub workflow commit 5b458d8 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:43:01 2024 +0530 Fix to github workflow for build commit 401bd27 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:40:32 2024 +0530 Further fix to build commit 0d7d2aa Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:25:34 2024 +0530 Further fix to micromamba commit b88d231 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:23:14 2024 +0530 Further fix to micromamba command commit 1401e35 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:21:03 2024 +0530 Fixed micromamba commands commit 7cc0289 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:16:23 2024 +0530 Fix for github action commit 2c4c4ed Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 22:07:29 2024 +0530 Attempting github action to build for both Ubuntu and MacOSX M1 commit d91ca02 Author: Subhasis Ray <[email protected]> Date: Mon Apr 22 21:20:26 2024 +0530 Build updated - Removed deprecated CMake version setting - Removed python2: out of life. Only supporting Python>=3.8 - Removed pybind11: should be installed directly with pip - Added MacOSX build workflow: to be tested --------- Co-authored-by: HarshaRani <[email protected]>
1 parent 8939ede commit 94fe3d6

File tree

291 files changed

+155
-64900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+155
-64900
lines changed

.ci/build_wheels_osx.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export PATH=/usr/local/bin:$PATH
1111
brew update || echo "Failed to update brew"
1212
brew install gsl || brew upgrade gsl
1313
brew upgrade python3 || echo "Failed to upgrade python3"
14-
brew upgrade python2 || echo "Failed to upgrade python2"
1514
brew upgrade python || echo "Failed to upgrade python"
1615

1716
# Following are to remove numpy; It is breaking the build on Xcode9.4.
@@ -48,7 +47,7 @@ for _py in 3 2; do
4847
$PYTHON -m pip install numpy --upgrade --user
4948
$PYTHON -m pip install twine --upgrade --user
5049

51-
PLATFORM=$($PYTHON -c "import distutils.util; print(distutils.util.get_platform())")
50+
PLATFORM=$($PYTHON -c "import sysconfig; print(sysconfig.get_platform())")
5251

5352
(
5453
cd $MOOSE_SOURCE_DIR

.ci/travis_build_linux.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ set -x
1212
BUILDDIR=_build_travis
1313
mkdir -p $BUILDDIR
1414

15-
PYTHON2="/usr/bin/python2"
1615
PYTHON3="/usr/bin/python3"
1716

18-
$PYTHON2 -m pip install pip --upgrade --user
19-
$PYTHON2 -m pip install libNeuroML numpy==1.14 scipy==1.2 \
20-
pyNeuroML python-libsbml --upgrade --user
2117

2218
$PYTHON3 -m pip install pip --upgrade --user
2319
$PYTHON3 -m pip install libNeuroML pyNeuroML python-libsbml --upgrade --user
@@ -37,7 +33,6 @@ unset PYTHONPATH
3733
# many not be available. Therefore, it is neccessary to use fixed path for
3834
# python executable.
3935

40-
$PYTHON2 -m compileall -q .
4136
$PYTHON3 -m compileall -q .
4237

4338
# Python3 with GSL in debug more.
@@ -68,13 +63,5 @@ $PYTHON3 -m compileall -q .
6863
make coverage
6964
)
7065

71-
# GSL and python2, failure is allowed
72-
set +e
73-
(
74-
mkdir -p $BUILDDIR && cd $BUILDDIR && \
75-
cmake -DPYTHON_EXECUTABLE=$PYTHON2 -DCMAKE_INSTALL_PREFIX=/usr ..
76-
$MAKE && MOOSE_NUM_THREADS=$NPROC ctest -j$NPROC --output-on-failure
77-
)
78-
set -e
7966

8067
echo "All done"

.github/workflows/pymoose.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,37 @@ on: [push]
44

55
jobs:
66
build:
7-
name : Python Package
8-
9-
runs-on: ubuntu-latest
10-
strategy:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
119
matrix:
12-
python-version: [3.8, 3.9, '3.10',3.11,3.12]
13-
10+
os: [ubuntu-latest, macos-14]
11+
build_type: [Release]
12+
c_compiler: [clang]
13+
python-version: ["3.12"]
14+
include:
15+
- os: ubuntu-latest
16+
apt: 10
17+
- os: macos-14
18+
brew: 20
1419
steps:
1520
- uses: actions/checkout@v2
21+
- if: ${{ matrix.apt }}
22+
run: sudo apt-get install libhdf5-dev libgsl0-dev
23+
- if: ${{ matrix.brew }}
24+
run: |
25+
brew install gsl
26+
brew install hdf5
1627
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v1
18-
with:
19-
python-version: ${{ matrix.python-version }}
20-
- name: Install dependencies
28+
shell: bash
2129
run: |
22-
export DEBIAN_FRONTEND=noninteractive
23-
sudo -E apt clean
24-
sudo -E apt update
25-
sudo -E apt install -y cmake libgsl-dev g++ gcc git
26-
sudo -E apt install python3-tk
27-
sudo -E apt install -y libhdf5-dev doxygen
28-
python -m pip install numpy matplotlib vpython --user
30+
"${SHELL}" <(curl -L micro.mamba.pm/install.sh)
31+
micromamba self-update
32+
micromamba create -n moose python=${{ matrix.python-version }} graphviz lxml cmake numpy matplotlib vpython hdf5 pytables doxygen -c conda-forge
33+
eval "$(micromamba shell hook --shell bash)"
34+
micromamba activate moose
35+
pip install python-libsbml
36+
pip install pyneuroml
2937
- name: Build
3038
run: |
31-
pip install .
39+
pip install .
40+

CMakeLists.txt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.2.3 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
22

33
# Project to build MOOSE's python module.
44
project(PyMOOSE)
@@ -317,13 +317,18 @@ endif( WITH_BOOST )
317317

318318
######################### BUILD PYMOOSE ########################################
319319

320-
if(NOT WITH_LEGACY_BINDING)
321-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/pybind11)
322-
add_subdirectory(pybind11)
323-
else()
324-
message(STATUS "Building legacy python binding.")
325-
add_subdirectory(pymoose)
326-
endif()
320+
# pybind11 should be installed as a dependency.
321+
# It can be easily done with `pip install pybind11`
322+
# See: https://pybind11.readthedocs.io/en/stable/installing.html
323+
# - Subha, Mon Apr 22 14:26:58 IST 2024
324+
325+
# if(NOT WITH_LEGACY_BINDING)
326+
# add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/pybind11)
327+
# add_subdirectory(pybind11)
328+
# else()
329+
# message(STATUS "Building legacy python binding.")
330+
# add_subdirectory(pymoose)
331+
# endif()
327332

328333

329334
# always override debian default installation directory. It will be installed in

CONTRIBUTING.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
To contribute, fork this repo and submit your changes via a pull-request.
2-
Before sending pull-request, check the following:
1+
We use the `fork-and-pull` workflow for moose development.
32

4-
- [ ] Software builds locally
5-
- [ ] `ctest --output-on-failure` passes all tests.
3+
To contribute:
4+
1. Fork this repo on github
5+
2. Make the changes you want to contribute
6+
3. Check that moose builds locally on your version
7+
4. Check all tests pass `ctest --output-on-failure` passes all tests (TODO: cleanup/fix/update the tests)
8+
5. Submit your changes via a pull-request.
9+
10+
After this the repository admin will check your pull request and merge it to the main branch.

CheckCXXCompiler.cmake

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ endif()
77

88
########################### COMPILER MACROS #####################################
99
include(CheckCXXCompilerFlag)
10-
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11 )
11-
CHECK_CXX_COMPILER_FLAG("-Wno-strict-aliasing" COMPILER_WARNS_STRICT_ALIASING )
10+
if(WIN32)
11+
CHECK_CXX_COMPILER_FLAG("/std:c++14" COMPILER_SUPPORTS_CXX14 )
12+
else(WIN32)
13+
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14 )
14+
CHECK_CXX_COMPILER_FLAG("-Wno-strict-aliasing" COMPILER_WARNS_STRICT_ALIASING )
15+
endif(WIN32)
1216

1317
# Turn warning to error: Not all of the options may be supported on all
1418
# versions of compilers. be careful here.
@@ -42,15 +46,19 @@ if(COMPILER_SUPPORT_UNUSED_BUT_SET_VARIABLE_NO_WARN)
4246
add_definitions( "-Wno-unused-but-set-variable" )
4347
endif(COMPILER_SUPPORT_UNUSED_BUT_SET_VARIABLE_NO_WARN)
4448

45-
if(COMPILER_SUPPORTS_CXX11)
46-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
49+
if(COMPILER_SUPPORTS_CXX14)
50+
if(WIN32)
51+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++14")
52+
else(WIN32)
53+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
54+
endif(WIN32)
4755
if(APPLE)
4856
add_definitions( -mllvm -inline-threshold=1000 )
4957
endif(APPLE)
50-
else(COMPILER_SUPPORTS_CXX11)
58+
else(COMPILER_SUPPORTS_CXX14)
5159
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} is too old. \n"
52-
"Please use a compiler which has full c++11 support."
60+
"Please use a compiler which has full c++14 support."
5361
)
54-
endif(COMPILER_SUPPORTS_CXX11)
62+
endif(COMPILER_SUPPORTS_CXX14)
5563

5664
set(COMPILER_IS_TESTED ON)

INSTALL.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Building MOOSE
22

33
To build `MOOSE` from source, you need `cmake` and `python-setuptools`. We
4-
recommend to use Python 3.5 or higher. Python 2.7 is also supported.
4+
recommend to use Python 3.8 or higher.
55

66
Before running the following command to build and install, make sure that
77
followings are installed.
@@ -15,7 +15,7 @@ On Ubuntu-16.04 or higher, these dependencies can be installed with:
1515
sudo apt-get install python-pip python-numpy cmake libgsl-dev g++
1616
```
1717

18-
Now use `pip` to download and install the `pymoose`.
18+
Now use `pip` to download and install `pymoose` from the [github repository](https://github.com/BhallaLab/moose-core).
1919

2020
```
2121
$ pip install git+https://github.com/BhallaLab/moose-core --user
@@ -41,6 +41,12 @@ from github.
4141
This will build moose, `ctest` will run few tests to check if build process was
4242
successful.
4343

44+
To rebuild, delete the `_build` directory and the generated `_temp__build/` directory and recreate the `_build` directory:
45+
46+
$ cd ..; rm -rf _build; rm -rf _temp__build
47+
48+
and continue the steps following that described above.
49+
4450
To make in debug mode use:
4551
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
4652

basecode/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8)
1+
cmake_minimum_required(VERSION 3.20)
22
include( ${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake )
33
add_library(basecode
44
Element.cpp

basecode/global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ string moosePathToColumnName(const string& path, char delim, size_t maxParents)
226226
string toString(double x)
227227
{
228228
char buffer[50];
229-
sprintf(buffer, "%.17g", x);
229+
snprintf(buffer, sizeof buffer, "%.17g", x);
230230
return string(buffer);
231231
}
232232

biophysics/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8)
1+
cmake_minimum_required(VERSION 3.20)
22
include(${CMAKE_CURRENT_SOURCE_DIR}/../CheckCXXCompiler.cmake)
33

44
if(WITH_GSL)

0 commit comments

Comments
 (0)