-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from Morpho-lang/dev
Morpho v0.6.0
- Loading branch information
Showing
491 changed files
with
19,738 additions
and
72,180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,42 @@ | ||
name: NoNaNBoxing Tests | ||
name: No NANBoxing | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ main, dev ] | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build_and_test: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: configure | ||
run: | | ||
run: | | ||
sudo apt update | ||
sudo apt install libglfw3 | ||
sudo apt install libsuitesparse-dev | ||
sudo apt install liblapacke-dev | ||
sudo apt install libunistring-dev | ||
python -m pip install --upgrade pip | ||
python -m pip install regex colored | ||
- name: makeNoNanBoxing | ||
run: (cd morpho5; sudo make -f Makefile.linux nonanboxing) | ||
- name: testNoNanBoxing | ||
run: (cd test; python3 test.py -c) | ||
- name: make | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DMORPHO_DISABLENANBOXING=ON .. | ||
sudo make install | ||
sudo mkdir /usr/local/lib/morpho | ||
- name: getcli | ||
run: | | ||
git clone https://github.com/Morpho-lang/morpho-cli.git | ||
cd morpho-cli | ||
mkdir build | ||
cd build | ||
cmake -DMORPHO_DISABLENANBOXING=ON .. | ||
sudo make install | ||
- name: test | ||
run: | | ||
cd test | ||
python3 test.py -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: configure | ||
run: | | ||
sudo apt update | ||
sudo apt install libsuitesparse-dev | ||
sudo apt install liblapacke-dev | ||
python -m pip install --upgrade pip | ||
python -m pip install regex colored | ||
- name: make | ||
run: (mkdir build; cd build; cmake ..; sudo make install) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build and Test | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: configure | ||
run: | | ||
sudo apt update | ||
sudo apt install libsuitesparse-dev | ||
sudo apt install liblapacke-dev | ||
sudo apt install libunistring-dev | ||
python -m pip install --upgrade pip | ||
python -m pip install regex colored | ||
- name: make | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_BUILD_TYPE=Release .. | ||
sudo make install | ||
sudo mkdir /usr/local/lib/morpho | ||
- name: getcli | ||
run: | | ||
git clone https://github.com/Morpho-lang/morpho-cli.git | ||
cd morpho-cli | ||
mkdir build | ||
cd build | ||
cmake .. | ||
sudo make install | ||
- name: test | ||
run: | | ||
cd test | ||
python3 test.py -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: No NANBoxing | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: configure | ||
run: | | ||
sudo apt update | ||
sudo apt install libsuitesparse-dev | ||
sudo apt install liblapacke-dev | ||
sudo apt install libunistring-dev | ||
python -m pip install --upgrade pip | ||
python -m pip install regex colored | ||
- name: make | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake -DMORPHO_DISABLENANBOXING=ON .. | ||
sudo make install | ||
sudo mkdir /usr/local/lib/morpho | ||
- name: getcli | ||
run: | | ||
git clone https://github.com/Morpho-lang/morpho-cli.git | ||
cd morpho-cli | ||
mkdir build | ||
cd build | ||
cmake -DMORPHO_DISABLENANBOXING=ON .. | ||
sudo make install | ||
- name: test | ||
run: | | ||
cd test | ||
python3 test.py -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"cmake.configureOnOpen": true, | ||
"files.associations": { | ||
"builtin.h": "c", | ||
"value.h": "c", | ||
"error.h": "c" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
project(morpho-libmorpho) | ||
|
||
option(MORPHO_DISABLENANBOXING "Disables NAN Boxing" OFF) | ||
|
||
option(MORPHO_GCSTRESSTEST "Stress tests the garbage collector" OFF) | ||
|
||
add_library(morpho SHARED "") | ||
add_subdirectory(src) | ||
|
||
# Include morpho header files across the project | ||
target_include_directories(morpho PUBLIC src | ||
src/builtin | ||
src/classes | ||
src/core | ||
src/datastructures | ||
src/debug | ||
src/geometry | ||
src/linalg | ||
src/support ) | ||
|
||
# Option to disable NAN Boxing | ||
if(MORPHO_DISABLENANBOXING) | ||
target_compile_definitions(morpho PUBLIC _NO_NAN_BOXING) | ||
endif() | ||
|
||
# Option to stress test Garbage Collector | ||
if(MORPHO_GCSTRESSTEST) | ||
target_compile_definitions(morpho PUBLIC _DEBUG_STRESSGARBAGECOLLECTOR) | ||
endif() | ||
|
||
# Set resources directory | ||
if(MORPHO_RESOURCESDIR) | ||
target_compile_definitions(morpho PUBLIC MORPHO_RESOURCESDIR=\"${MORPHO_RESOURCESDIR}\") | ||
endif() | ||
|
||
# Create source groups for IDE | ||
source_group("builtin" REGULAR_EXPRESSION src/builtin/.*\\.[ch]) | ||
source_group("classes" REGULAR_EXPRESSION src/classes/.*\\.[ch]) | ||
source_group("core" REGULAR_EXPRESSION src/core/.*\\.[ch]) | ||
source_group("datastructures" REGULAR_EXPRESSION src/datastructures/.*\\.[ch]) | ||
source_group("debug" REGULAR_EXPRESSION src/debug/.*\\.[ch]) | ||
source_group("geometry" REGULAR_EXPRESSION src/geometry/.*\\.[ch]) | ||
source_group("linalg" REGULAR_EXPRESSION src/linalg/.*\\.[ch]) | ||
source_group("support" REGULAR_EXPRESSION src/support/.*\\.[ch]) | ||
|
||
# Find suitesparse cs.h header file | ||
find_file(SUITESPARSE_HEADER cs.h | ||
HINTS | ||
/home/linuxbrew/.linuxbrew/include/suitesparse | ||
/usr/local/include | ||
/usr/local/include/suitesparse | ||
/opt/homebrew/include/suitesparse | ||
/usr/include/suitesparse) | ||
|
||
# Identify folder that cs.h is located in from SUITESPARSE_HEADER and store in SUITESPARSE_INCLUDE | ||
get_filename_component(SUITESPARSE_INCLUDE ${SUITESPARSE_HEADER} DIRECTORY) | ||
|
||
# Add morpho headers to MORPHO_INCLUDE | ||
target_include_directories(morpho PUBLIC ${SUITESPARSE_INCLUDE}) | ||
|
||
# Locate a lapack version | ||
# Currently we prefer LAPACKE | ||
# TODO: Fix morpho source to select between lapack and lapacke | ||
find_library(LAPACK_LIBRARY | ||
NAMES lapacke liblapacke lapack liblapack | ||
) | ||
|
||
# Locate cblas | ||
find_library(CBLAS_LIBRARY | ||
NAMES cblas libcblas blas libblas | ||
) | ||
|
||
# Locate suitesparse | ||
find_library(SUITESPARSE_LIBRARY | ||
NAMES cxsparse libcxsparse | ||
) | ||
|
||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
|
||
target_link_libraries(morpho ${SUITESPARSE_LIBRARY} ${CBLAS_LIBRARY} ${LAPACK_LIBRARY} ${CMAKE_DL_LIBS} Threads::Threads) | ||
|
||
# Install the resulting library | ||
install(TARGETS morpho) | ||
|
||
# Install morpho header files | ||
# The below works in 3.23, which is too recent for Ubuntu | ||
# install(TARGETS morpho | ||
# FILE_SET public_headers | ||
# DESTINATION include/morpho | ||
#) | ||
|
||
# So we'll use a hacky way for now | ||
file(GLOB_RECURSE MORPHO_HEADER_FILES "src/*.h") | ||
install(FILES ${MORPHO_HEADER_FILES} DESTINATION include/morpho) | ||
|
||
# Similarly install morpho modules | ||
file(GLOB_RECURSE MORPHO_MODULES_FILES "modules/*.morpho") | ||
install(FILES ${MORPHO_MODULES_FILES} DESTINATION share/morpho/modules) | ||
|
||
# Similarly install morpho help files | ||
file(GLOB_RECURSE MORPHO_HELP_FILES "help/*.md") | ||
install(FILES ${MORPHO_HELP_FILES} DESTINATION share/morpho/help) |
Oops, something went wrong.