From ef62395dd8f93b958d0de49b95d820506c05f0a9 Mon Sep 17 00:00:00 2001 From: Noah Stuertz Date: Sun, 10 Dec 2023 10:51:02 +0100 Subject: [PATCH 1/5] add nix flake support fix version added shell new flake fix description added flake lock added nix documentation added basic package file remove unused dependency added devshell support Remove check --- README.md | 37 ++++++++++++++++++-------- flake.lock | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 22 ++++++++++++++++ package.nix | 26 ++++++++++++++++++ shell.nix | 24 +++++++++++++++++ 5 files changed, 174 insertions(+), 11 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 package.nix create mode 100644 shell.nix diff --git a/README.md b/README.md index ec8788ef6..4a41bb976 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,29 @@ ![example branch parameter](https://github.com/jlab/gapc/actions/workflows/c-cpp.yml/badge.svg) [![Anaconda-Server Badge](https://anaconda.org/bioconda/bellmans-gapc/badges/version.svg)](https://anaconda.org/bioconda/bellmans-gapc) Launchpad logo + ``` - ____ _ _ _ _____ _____ - | _ \ | | | ( ) / ____| /\ | __ \ + ____ _ _ _ _____ _____ + | _ \ | | | ( ) / ____| /\ | __ \ | |_) | ___| | |_ __ ___ __ _ _ __ |/ ___ | | __ / \ | |__) | - | _ < / _ \ | | '_ ` _ \ / _` | '_ \ / __| | | |_ | / /\ \ | ___/ - | |_) | __/ | | | | | | | (_| | | | | \__ \ | |__| |/ ____ \| | - |____/ \___|_|_|_| |_| |_|\__,_|_| |_| |___/ \_____/_/ \_\_| -``` - + | _ < / _ \ | | '_ ` _ \ / _` | '_ \ / __| | | |_ | / /\ \ | ___/ + | |_) | __/ | | | | | | | (_| | | | | \__ \ | |__| |/ ____ \| | + |____/ \___|_|_|_| |_| |_|\__,_|_| |_| |___/ \_____/_/ \_\_| +``` + ## Dependencies Bellman's GAP was tested on the following dependencies. compile time: + - C++ compiler (GCC g++ for example) - C compiler (GCC for example) - Flex >= 2.5.34 - GNU bison >= 2.4.1 - GNU make >= 3.81 - Mercurial >= 0.9.5 -- boost >= 1.36 (1.34 without the Accumulators Framework) +- boost >= 1.36 (1.34 without the Accumulators Framework) - unittest framework (libboost-test-dev) - pool - program options (libboost-program-options-dev) @@ -30,7 +32,8 @@ compile time: - ksh93 - or - bash >= 2.03.0(1) (only needed for test scripts) runtime: -- boost >= 1.36 (1.34 without the Accumulators Framework) + +- boost >= 1.36 (1.34 without the Accumulators Framework) - pool - program options - cstdint @@ -41,7 +44,6 @@ runtime: Always get the latest sources from github: `git clone https://github.com/jlab/gapc.git` - ## INSTALLATION ### from source @@ -55,6 +57,7 @@ To install Bellman's GAP from source call: If `--prefix` is not set the path defaults to `/usr/local` More options for `./configure` are: + ``` CXX= CC= @@ -68,6 +71,7 @@ BISON= ### conda You can find [conda](https://bioconda.github.io/user/install.html) packages for linux-64 and osx-64 in the [bioconda channel: https://anaconda.org/bioconda/bellmans-gapc](https://anaconda.org/bioconda/bellmans-gapc) for easy installation into your conda environment: + ``` conda install -c bioconda bellmans-gapc ``` @@ -77,18 +81,29 @@ conda install -c bioconda bellmans-gapc Bellman's GAP is available as a pre-compiled Debian package via Ubuntus launchpad system, a Ubuntu Personal Package Archive (PPA). Packages for Ubuntu versions 16.04 (Xenial) and newer can be obtained from janssenlab/software. On your command line, execute the three following commands + ``` sudo add-apt-repository ppa:janssenlab/software sudo apt-get update sudo apt-get install bellmansgapc ``` -For older Ubuntu releases, have a look at bibi-help/bibitools (Ubuntu versions 10.04, 11.10, 12.04, 12.10, 13.04, 13.10, 14.04, 14.10, 15.04) + +For older Ubuntu releases, have a look at bibi-help/bibitools (Ubuntu versions 10.04, 11.10, 12.04, 12.10, 13.04, 13.10, 14.04, 14.10, 15.04) + ``` sudo add-apt-repository ppa:bibi-help/bibitools sudo apt-get update sudo apt-get install bellmansgapc ``` +### Nix + +Bellman's GAP is available as a flake the current version of the build can be installed by executing the following command: + +``` +nix build github:jlab/gapc +``` + ### MacPorts Under Mac OS X you may want to use MacPorts to install the compiler. There is a (most likely outdated) ports description on the BiBiServ MacPorts repository. You can install GAP-C via: diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..71ab00bf8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,76 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1702321677, + "narHash": "sha256-jK2stIbCXfzO+ctrFSgos2DlNIoAOXYLFmFJ8XNfmVs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b8dec7521fa2654cc34150c52212bacf9803519c", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..54105649c --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "Bellman's GAP compiler"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + systems.url = "github:nix-systems/default"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + systems, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem + (system: let + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.default = pkgs.callPackage ./package.nix {}; + devShells.default = import ./shell.nix {inherit pkgs;}; + }); +} diff --git a/package.nix b/package.nix new file mode 100644 index 000000000..f4b117ed0 --- /dev/null +++ b/package.nix @@ -0,0 +1,26 @@ +{ + stdenv, + fetchFromGitHub, + flex, + bison, + boost, + gsl, +}: +stdenv.mkDerivation { + name = "gapc"; + version = "2023-07-05"; + + src = fetchFromGitHub { + owner = "jlab"; + repo = "gapc"; + rev = "2023.07.05"; + sha256 = "sha256-OzGf8Z4BzHEPmonlOvvvg5G1y1mtrkWSxOHPfBJU7kU="; + }; + + nativeBuildInputs = [flex bison gsl]; + buildInputs = [boost]; + configureFlags = ["BOOST_LDFLAGS=-L${boost}/lib"]; + + doCheck = false; + checkTarget = "test"; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..34adb8098 --- /dev/null +++ b/shell.nix @@ -0,0 +1,24 @@ +{pkgs ? import {}}: +with pkgs; + mkShell { + nativeBuildInputs = [flex bison gsl]; + buildInputs = [ + nixpkgs-fmt + (callPackage ./package.nix {}) + gdb + gcc + gpp + lldb + clang + boost + flex + bison + gsl + mercurial + ]; + + configureFlags = ["BOOST_LDFLAGS=-L${boost}/lib"]; + shellHook = '' + ./configure --prefix=$(pwd)/debug --with-boost=yes + ''; + } From 6d07c8d84bc407ccde7b3fb3428ec2ba45bf5b3f Mon Sep 17 00:00:00 2001 From: crsct Date: Sun, 9 Mar 2025 11:33:41 +0100 Subject: [PATCH 2/5] Update shell.nix --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 34adb8098..18f81a8c4 100644 --- a/shell.nix +++ b/shell.nix @@ -4,7 +4,7 @@ with pkgs; nativeBuildInputs = [flex bison gsl]; buildInputs = [ nixpkgs-fmt - (callPackage ./package.nix {}) + #(callPackage ./package.nix {}) gdb gcc gpp From 3fdf26cccae98d74eb22c365236c0958a0881157 Mon Sep 17 00:00:00 2001 From: crsct Date: Sun, 9 Mar 2025 11:56:32 +0100 Subject: [PATCH 3/5] Update shell.nix --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 18f81a8c4..89e25a8e3 100644 --- a/shell.nix +++ b/shell.nix @@ -19,6 +19,7 @@ with pkgs; configureFlags = ["BOOST_LDFLAGS=-L${boost}/lib"]; shellHook = '' + export BOOST_LDFLAGS=-L${boost}/lib ./configure --prefix=$(pwd)/debug --with-boost=yes ''; } From 9f1005b0564619ce2fa6157c4c920c62b60a707a Mon Sep 17 00:00:00 2001 From: Noah Stuertz Date: Thu, 13 Mar 2025 14:24:35 +0100 Subject: [PATCH 4/5] Add CPP Linting to the Shell --- shell.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 89e25a8e3..bfe76bc27 100644 --- a/shell.nix +++ b/shell.nix @@ -5,6 +5,7 @@ with pkgs; buildInputs = [ nixpkgs-fmt #(callPackage ./package.nix {}) + cpplint gdb gcc gpp @@ -20,6 +21,6 @@ with pkgs; configureFlags = ["BOOST_LDFLAGS=-L${boost}/lib"]; shellHook = '' export BOOST_LDFLAGS=-L${boost}/lib - ./configure --prefix=$(pwd)/debug --with-boost=yes + # ./configure --prefix=$(pwd)/debug --with-boost=yes ''; } From 341ee1a3fb72711a2ec7e9456e66b7ec249775b6 Mon Sep 17 00:00:00 2001 From: Noah Stuertz Date: Tue, 25 Mar 2025 11:33:27 +0100 Subject: [PATCH 5/5] Added adaptivecpp to the shell via unstable branch --- flake.lock | 17 +++++++++++++++++ flake.nix | 14 ++++++++++++-- shell.nix | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 71ab00bf8..df5babffd 100644 --- a/flake.lock +++ b/flake.lock @@ -33,10 +33,27 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1742800061, + "narHash": "sha256-oDJGK1UMArK52vcW9S5S2apeec4rbfNELgc50LqiPNs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1750f3c1c89488e2ffdd47cab9d05454dddfb734", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable", "systems": "systems_2" } }, diff --git a/flake.nix b/flake.nix index 54105649c..45cc20071 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ description = "Bellman's GAP compiler"; inputs = { nixpkgs.url = "github:nixos/nixpkgs"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; systems.url = "github:nix-systems/default"; flake-utils.url = "github:numtide/flake-utils"; }; @@ -10,11 +11,20 @@ self, systems, nixpkgs, + nixpkgs-unstable, flake-utils, }: flake-utils.lib.eachDefaultSystem - (system: let - pkgs = nixpkgs.legacyPackages.${system}; + (system: let + pkgs = import nixpkgs { + inherit system; + overlays = [ + # make unstable packages available via overlay + (final: prev: { + unstable = nixpkgs-unstable.legacyPackages.${prev.system}; + }) + ]; + }; in { packages.default = pkgs.callPackage ./package.nix {}; devShells.default = import ./shell.nix {inherit pkgs;}; diff --git a/shell.nix b/shell.nix index bfe76bc27..67d87057f 100644 --- a/shell.nix +++ b/shell.nix @@ -4,6 +4,7 @@ with pkgs; nativeBuildInputs = [flex bison gsl]; buildInputs = [ nixpkgs-fmt + unstable.adaptivecpp #(callPackage ./package.nix {}) cpplint gdb