Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.2 #6

Merged
merged 40 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8bbd4fe
DOC: Add fpm compatible in readme.
MilanSkocic Sep 2, 2023
a1ad097
BLD: Add src generaor in Makefile.
MilanSkocic Sep 3, 2023
d1d9057
ENH: Increase gcc/gfortran version requierement.
MilanSkocic Sep 3, 2023
85aca5a
BLD: Remove uncessary dependency in target.
MilanSkocic Sep 3, 2023
ca33e11
BUG: Fix conditional ADD_IMPORT macro for windows.
MilanSkocic Sep 6, 2023
4313e86
BLD: Migrate to pyproject.toml
MilanSkocic Sep 21, 2023
4c3a328
BLD: Add build package dependency.
MilanSkocic Oct 16, 2023
3a745ed
BLD: Improve Makefile.
MilanSkocic Oct 17, 2023
9a95043
BLD: Update to configuration file.
MilanSkocic Oct 29, 2023
7e6fbb8
ENH: Start rewriting generator in Fortran.
MilanSkocic Nov 7, 2023
a98b4db
ENH: Update the fortran version for parsing.
MilanSkocic Nov 7, 2023
c177052
ENH: Update Fortran parser.
MilanSkocic Nov 7, 2023
b6e1456
ENH: Add complete parser in FOrtran.
MilanSkocic Nov 7, 2023
ad6237d
BLD: Add C code to parser in fortran.
MilanSkocic Nov 10, 2023
200f6dc
BLD: Add workflow.
MilanSkocic Nov 13, 2023
fe37461
BLD: Switch to fortran generator for codata.f90 and codata.h
MilanSkocic Nov 13, 2023
f285eaf
BLD: Switch to Fortran generator for codata.txt.
MilanSkocic Nov 13, 2023
6feba6f
BLD: Final cpython code in Fortran.
MilanSkocic Nov 14, 2023
fec60b7
BLD: Final cpython code in Fortran.
MilanSkocic Nov 14, 2023
4977402
BLD: Remove C version of generator.
MilanSkocic Nov 14, 2023
a83f951
BLD: Completed the transition to generator in pure Fortran.
MilanSkocic Nov 14, 2023
047f77d
DOC: Fix build badge.
MilanSkocic Nov 15, 2023
e971e34
DOC: Add both branches for badge.
MilanSkocic Nov 15, 2023
38969a9
DOC: Add both branches for badge.
MilanSkocic Nov 15, 2023
f2ba3cb
DOC: Add both branches for badge.
MilanSkocic Nov 15, 2023
449c37e
DOC: Add both branches for badge.
MilanSkocic Nov 15, 2023
38a0d45
DOC: Add both branches for badge.
MilanSkocic Nov 15, 2023
56f4660
REL: Prepare new version.
MilanSkocic Nov 18, 2023
04c61c7
DOC: Add changelog for new version.
MilanSkocic Nov 18, 2023
b58e11a
BLD: Update build scripts for pywrapper.
MilanSkocic Nov 18, 2023
c8db4b1
BLD: Change build options for pywrapper.
MilanSkocic Nov 18, 2023
07d31ef
BLD: Add test in Makefile.
MilanSkocic Nov 20, 2023
b389ec8
Merge branch 'dev' of https://github.com/MilanSkocic/codata into dev
MilanSkocic Nov 20, 2023
b89b348
BLD: Fix test case.
MilanSkocic Nov 21, 2023
d174c62
BLD: Add automatic detection of ARCH and VERSION.
MilanSkocic Nov 23, 2023
24a9460
BUG: Fix bash issue.
MilanSkocic Nov 24, 2023
4c2a4cd
BUG: Fix email for FORD v7.
MilanSkocic Nov 27, 2023
4fc4a41
DOC: Add changelog 0.8.2.
MilanSkocic Nov 27, 2023
dae9994
DOC: Generate online doc.
MilanSkocic Nov 27, 2023
025fed3
Merge branch 'main' into dev
MilanSkocic Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]

jobs:
linux:
runs-on: ubuntu-latest
steps:
- name: Gfortran
run: |
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-10 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-10
- name: Set FPM
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: "v0.9.0"
- name: Gfortran version
run : gfortran --version
- name: Checkout
uses: actions/checkout@v4
- name: Compile
run: |
. ./configure.sh
make

macos:
runs-on: macos-latest
steps:
- name: Gfortran
run: |
brew reinstall gcc@10 gcc@13
- name: Set FPM
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: "v0.9.0"
- name: Gfortran version
run : gfortran --version
- name: Checkout
uses: actions/checkout@v4
- name: Compile
run: |
. ./configure.sh
make

windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: MSYS2, Gfortran, fpm
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: >-
mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-fpm
git
make
- name: Gfortran version
run : gfortran --version
- name: Checkout
uses: actions/checkout@v4
- name: Compile
run: |
. ./configure.sh
make
6 changes: 4 additions & 2 deletions INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
A Makefile is provided, which uses `fpm <https://fpm.fortran-lang.org/en/index.html>`_, for building the library.
A Makefile is provided, which uses `fpm <https://fpm.fortran-lang.org/en/index.html>`_,
for building the library.

On windows, `msys2 <https://www.msys2.org>`_ needs to be installed.

Expand All @@ -8,7 +9,8 @@ Build: the configuration file will set all the environmental variables necessary

.. code-block:: bash

source configuration
chmod +x configure.sh
. ./configure.sh
make

Run tests
Expand Down
56 changes: 41 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ endif

.PHONY: all clean install uninstall copy_h copy_a shared_linux shared_windows shared_darwin

all: $(LIBNAME)
all: generator $(LIBNAME)

generator:
make -C ./srcgen

$(LIBNAME): build copy_h copy_a shared copy_shared

Expand All @@ -15,40 +18,63 @@ build: clean

shared: shared_$(PLATFORM)

copy_shared: copy_shared_$(PLATFORM)

shared_linux:
gfortran -shared -o $(BUILD_DIR)/lib$(LIBNAME).so -Wl,--whole-archive $(BUILD_DIR)/lib$(LIBNAME).a -Wl,--no-whole-archive

shared_darwin:
gfortran -dynamiclib -install_name @rpath/lib$(LIBNAME).dylib -static-libgfortran -static-libquadmath -static-libgcc -o $(BUILD_DIR)/lib$(LIBNAME).dylib -Wl,-all_load $(BUILD_DIR)/lib$(LIBNAME).a -Wl,-noall_load
gfortran -dynamiclib -install_name @rpath/lib$(LIBNAME).dylib $(FPM_LDFLAGS) -o $(BUILD_DIR)/lib$(LIBNAME).dylib -Wl,-all_load $(BUILD_DIR)/lib$(LIBNAME).a

shared_windows:
gfortran -shared -static -o $(BUILD_DIR)/lib$(LIBNAME).dll -Wl,--out-implib=$(BUILD_DIR)/lib$(LIBNAME).dll.a,--export-all-symbols,--enable-auto-import,--whole-archive $(BUILD_DIR)/lib$(LIBNAME).a -Wl,--no-whole-archive
gfortran -shared $(FPM_LDFLAGS) -o $(BUILD_DIR)/lib$(LIBNAME).dll -Wl,--out-implib=$(BUILD_DIR)/lib$(LIBNAME).dll.a,--export-all-symbols,--enable-auto-import,--whole-archive $(BUILD_DIR)/lib$(LIBNAME).a -Wl,--no-whole-archive

copy_a:
cp $(shell find ./build -type f -name lib$(LIBNAME).a) $(BUILD_DIR)
cp -f $(shell find ./build -type f -name lib$(LIBNAME).a) $(BUILD_DIR)
cp -f $(BUILD_DIR)/lib$(LIBNAME).a $(BUILD_DIR)/lib$(LIBNAME)-$(PLATFORM)-$(ARCH)-$(VERSION).a

copy_h:
cp $(INCLUDE_DIR)/$(LIBNAME)*.h $(PYW_MOD_DIR)/
cp -f $(INCLUDE_DIR)/$(LIBNAME)*.h $(PYW_MOD_DIR)/

copy_shared_linux:
cp -f $(BUILD_DIR)/lib$(LIBNAME).so $(BUILD_DIR)/lib$(LIBNAME)-$(PLATFORM)-$(ARCH)-$(VERSION).so
cp -f $(BUILD_DIR)/lib$(LIBNAME).so $(PYW_MOD_DIR)

copy_shared_darwin:
cp $(BUILD_DIR)/lib$(LIBNAME).dylib $(BUILD_DIR)/lib$(LIBNAME)-$(PLATFORM)-$(ARCH)-$(VERSION).dylib
cp -f $(BUILD_DIR)/lib$(LIBNAME).dylib $(PYW_MOD_DIR)

copy_shared_windows:
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll $(BUILD_DIR)/lib$(LIBNAME)-$(PLATFORM)-$(ARCH)-$(VERSION).dll
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll.a $(BUILD_DIR)/lib$(LIBNAME)-$(PLATFORM)-$(ARCH)-$(VERSION).dll.a
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll $(PYW_MOD_DIR)
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll.a $(PYW_MOD_DIR)

copy_shared: copy_a
cp -f $(BUILD_DIR)/lib$(LIBNAME).so $(PYW_MOD_DIR) | true
cp -f $(BUILD_DIR)/lib$(LIBNAME).dylib $(PYW_MOD_DIR) | true
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll $(PYW_MOD_DIR) | true
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll.a $(PYW_MOD_DIR) | true
test: all
fpm test --profile=release

clean:
fpm clean --all
rm -f src/*.mod

install:
install: install_dirs install_$(PLATFORM)

install_dirs:
mkdir -p $(install_dir)/bin
mkdir -p $(install_dir)/include
mkdir -p $(install_dir)/lib
fpm install --prefix=$(install_dir)
cp -f ./include/*.h $(install_dir)/include
cp -f $(BUILD_DIR)/lib$(LIBNAME).so $(install_dir)/lib | true
cp -f $(BUILD_DIR)/lib$(LIBNAME).dylib $(install_dir)/lib | true
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll.a $(install_dir)/lib | true
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll $(install_dir)/bin | true

install_linux:
cp -f $(BUILD_DIR)/lib$(LIBNAME).so $(install_dir)/lib

install_darwin:
cp -f $(BUILD_DIR)/lib$(LIBNAME).dylib $(install_dir)/lib

install_windows:
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll.a $(install_dir)/lib
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll $(install_dir)/bin

uninstall:
rm -f $(install_dir)/include/$(LIBNAME)*.h
Expand Down
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.. |cidev| image:: https://github.com/MilanSkocic/codata/actions/workflows/ci.yml/badge.svg?branch=dev
.. |cimain| image:: https://github.com/MilanSkocic/codata/actions/workflows/ci.yml/badge.svg?branch=main

dev |cidev| / main |cimain|

Description
==============

Expand All @@ -9,6 +14,14 @@ The raw codata are taken from http://physics.nist.gov/constants.

.. readme_inclusion_end

To use `codata` within your `fpm <https://github.com/fortran-lang/fpm>`_ project,
add the following to your `fpm.toml` file:

.. code-block::

[dependencies]
codata = { git="https://github.com/MilanSkocic/codata.git" }

Installation
================

Expand Down
4 changes: 2 additions & 2 deletions REQUIREMENTS.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
gcc>=9
gfortran>=9
gcc>=10
gfortran>=10
20 changes: 20 additions & 0 deletions configuration → configure.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ FPM_LDFLAGS="-static"
DEFAULT_INSTALL_DIR="$HOME/.local"
PLATFORM="linux"

IFS='-'
tmp=$(gcc -dumpmachine)
read -a tmp_arr <<< "$tmp"
ARCH="${tmp_arr[0]}"

IFS="="
while read -r line; do
# Reading line by line
if [[ $line == "version"* ]]
then
read -a tmp_arr <<< "$line"
VERSION=${tmp_arr[1]:2:5}
break
fi
done < "fpm.toml"

if [[ "$OSTYPE" == "msys" ]]; then
DEFAULT_INSTALL_DIR="${APPDATA//\\//}/local"
PLATFORM="windows"
Expand All @@ -31,9 +47,13 @@ export PYW_MOD_DIR
export BUILD_DIR
export INCLUDE_DIR
export PLATFORM
export ARCH
export VERSION

echo "OS TYPE=" $OSTYPE
echo "PLATFORM=" $PLATFORM
echo "ARCH=" $ARCH
echo "VERSION=" $VERSION
echo "DEFAULT INSTALL DIR=" $DEFAULT_INSTALL_DIR
echo "FPM_FLAGS=" $FPM_FFLAGS
echo "FPM_CFLAGS=" $FPM_CFLAGS
Expand Down
Binary file not shown.
28 changes: 28 additions & 0 deletions docs/_sources/releases/0.8.2-notes.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Codata 0.8.2 Release Note
============================

Summary
---------------

* No API changes.
* Improve Makefile for generating the source code at each compilation.
* Source generator rewritten in Fortran.
* Switch to pyproject.toml for the Python wrapper.
* Minor fixes in documentation.

Download
---------------

`Codata Releases <https://github.com/MilanSkocic/codata/releases>`_

`PYPI <https://pypi.org/project/pycodata>`_


Contributors
---------------
Milan Skocic

Commits
---------

**Full Changelog**: https://github.com/MilanSkocic/codata/compare/0.8.1...0.8.2
1 change: 1 addition & 0 deletions docs/_sources/releases/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release Notes
.. toctree::
:maxdepth: 1

0.8.2-notes.rst
0.8.1-notes.rst
0.8.0-notes.rst
0.7.1-notes.rst
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '0.8.1',
VERSION: '0.8.2',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
Loading