From a680ec057579c1b48f4a08c3872a4b175a7ef781 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 16 Oct 2023 23:59:45 +0200 Subject: [PATCH] Makefile is only for LIP6. Update nightly build. --- Makefile => Makefile.LIP6 | 92 ++++++++++++++++++++++----------------- bootstrap/socInstaller.py | 34 +++++---------- 2 files changed, 62 insertions(+), 64 deletions(-) rename Makefile => Makefile.LIP6 (54%) diff --git a/Makefile b/Makefile.LIP6 similarity index 54% rename from Makefile rename to Makefile.LIP6 index 35a49ed2..cdaa4f8b 100644 --- a/Makefile +++ b/Makefile.LIP6 @@ -1,37 +1,30 @@ - UNAME_S = $(shell uname -s) - UNAME_R = $(shell uname -r) - DEVTOOLSET_VERSION = 7 -# We must use devtoolset only under RHEL6 & clones. - DEVTOOLSET_OPTION = - ifeq ($(UNAME_S),Linux) - ifneq ($(findstring .el7.,$(UNAME_R)),) - DEVTOOLSET_OPTION = --devtoolset=$(DEVTOOLSET_VERSION) - endif - ifneq ($(findstring .slsoc6.,$(UNAME_R)),) - DEVTOOLSET_OPTION = --devtoolset=$(DEVTOOLSET_VERSION) - endif + venv = source .venv/bin/activate + localpath = export PATH=${HOME}/.local/bin:${PATH}; + + NIGHTLY_DIR = + ifneq ($(findstring nightly,$(shell pwd)),) + NIGHTLY_DIR = /nightly endif - venv = . venv/bin/activate - SMP_FLAGS = ifneq ($(shell which nproc 2> /dev/null),) SMP_FLAGS = -j$(shell nproc) endif - - ISYS_ROOT = $(shell ./bootstrap/coriolisEnv.py --query-isys-root) - INST_ROOT = $(shell ./bootstrap/coriolisEnv.py --query-inst-root) - WORK_ROOT = ${HOME}/coriolis-2.x/Linux.el9/Release.Shared + SRC_DIR = ${HOME}/coriolis-2.x$(NIGHTLY_DIR)/src + CORIOLIS_SRC = ${SRC_DIR}/coriolis + ALLIANCE_SRC = ${SRC_DIR}/alliance/alliance/src + BUILDTYPE = release + BUILDDIR = ${HOME}/coriolis-2.x$(NIGHTLY_DIR)/$(BUILDTYPE)/build + PREFIX = ${HOME}/coriolis-2.x$(NIGHTLY_DIR)/$(BUILDTYPE)/install help: @echo "============================================================================"; \ echo "Coriolis build & install top Makefile"; \ echo ""; \ - echo "This Makefile is only a wrapper around the Coriolis & Chams Builder tool"; \ - echo "(./boostrap/ccb.py)"; \ + echo "This Makefile is intended *only* for LIP6 users"; \ echo ""; \ echo "To build it, simply type (in coriolis/, at the shell prompt):"; \ echo " ego@home:coriolis> make install"; \ @@ -40,17 +33,18 @@ help: echo "To fully remove build & install:"; \ echo " ego@home:coriolis> make uninstall"; \ echo "============================================================================"; \ - echo "SMP_FLAGS = $(SMP_FLAGS)" ; \ - echo "ISYS_ROOT = $(ISYS_ROOT)" ; \ - echo "INST_ROOT = $(INST_ROOT)" ; \ + echo "SMP_FLAGS = $(SMP_FLAGS)" ; \ + echo "CORIOLIS_SRC = $(CORIOLIS_SRC)" ; \ + echo "BUILDDIR = $(BUILDDIR)" ; \ + echo "PREFIX = $(PREFIX)" ; \ echo "============================================================================"; check_dir: - @if [ "`pwd`" != "${HOME}/coriolis-2.x/src/coriolis" ]; then \ + @if [ "`pwd`" != "${CORIOLIS_SRC}" ]; then \ echo "Coriolis uses a fixed directory from the user's root."; \ echo "You must put in:"; \ - echo " <${HOME}/coriolis-2.x/src/coriolis>"; \ + echo " <${CORIOLIS_SRC}>"; \ echo "Instead of:"; \ echo " <`pwd`>"; \ echo "Stopping build."; \ @@ -58,37 +52,53 @@ check_dir: fi -check_venv: - @if [ ! -d "./venv" ]; then python3 -m venv venv; fi +$(HOME)/.local/bin/pdm: + @pip install pdm -pdm_deps: check_venv - @$(venv); pdm install --no-self +$(CORIOLIS_SRC)/.pdm-plugins/bin/pdm: $(HOME)/.local/bin/pdm + @$(localpath) pdm install --no-self -d --plugins -install: check_dir pdm_deps - @meson setup $(WORK_ROOT)/build - @meson configure $(WORK_ROOT)/build --prefix $(WORK_ROOT)/install - @ninja -v -C $(WORK_ROOT)/build install +install: check_dir $(CORIOLIS_SRC)/.pdm-plugins/bin/pdm + @$(localpath) pdm run meson setup ${BUILDDIR} --prefix=$(PREFIX) -Dpython.install_env=prefix + @$(localpath) pdm run ninja -C $(BUILDDIR) install @echo ""; \ echo "============================================================================"; \ echo "Coriolis has been successfully built"; \ echo "============================================================================"; \ echo "It has been installed under the directory:"; \ - echo " $(INST_ROOT)/{bin,lib,lib64,include,share,...}"; \ - echo ""; \ - echo "You can start the tool by running:"; \ - echo " ego@home:~> $(INST_ROOT)/bin/coriolis"; \ + echo " $(PREFIX)/{bin,lib,lib64,include,share,...}"; \ echo "============================================================================"; +install_alliance: + export ALLIANCE_TOP=$(PREFIX); \ + export LD_LIBRARY_PATH=$(PREFIX)/lib:$(LD_LIBRARY_PATH); \ + cd $(ALLIANCE_SRC); \ + sed -i 's,dirs="\\$$newdirs documentation",dirs="$$newdirs",' ./autostuff; \ + ./autostuff clean; \ + ./autostuff; \ + mkdir -p $(BUILDDIR); \ + cd $(BUILDDIR); \ + $(ALLIANCE_SRC)/configure --prefix=$(PREFIX) --enable-alc-shared; \ + make -j1 install + + clean_build: check_dir @echo "Removing the build tree only."; \ - echo " $(INST_ROOT)/../build"; \ - rm -rf $(INST_ROOT)/../build + echo " $(BUILDDIR)"; \ + rm -rf $(BUILDDIR) + + +clean_pdm: + @echo "Removing all pip, pdm & venv installed files." + rm -rf ${HOME}/.local + rm -rf ${CORIOLIS_SRC}/.venv + rm -f ${CORIOLIS_SRC}/.pdm_python + rm -rf ${CORIOLIS_SRC}/.pdm_plugins uninstall: check_dir @echo "Removing the whole build & install tree..."; \ - echo " $(ISYS_ROOT)"; \ - rm -rf $(ISYS_ROOT) + @$(localpath) pdm run ninja -C $(BUILDDIR) uninstall diff --git a/bootstrap/socInstaller.py b/bootstrap/socInstaller.py index 15ca8ec4..b0424628 100755 --- a/bootstrap/socInstaller.py +++ b/bootstrap/socInstaller.py @@ -210,18 +210,19 @@ class YosysCommand ( CommandArg ): class AllianceCommand ( CommandArg ): - def __init__ ( self, alcBin, fdLog=None ): - CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog ) + def __init__ ( self, fdLog=None ): + CommandArg.__init__ ( self, [ 'make' + , '-f', 'Makefile.LIP6' + , 'install_alliance' ], fdLog=fdLog ) return class CoriolisCommand ( CommandArg ): - def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ): - CommandArg.__init__ ( self, [ ccbBin - , '--root='+rootDir - , '--project=coriolis' - , '--make=-j{} install'.format(threads) + def __init__ ( self, rootDir, threads=1, otherArgs=[], fdLog=None ): + CommandArg.__init__ ( self, [ 'make' + , '-f', 'Makefile.LIP6' + , 'install' ] + otherArgs , fdLog=fdLog ) return @@ -333,7 +334,6 @@ class Configuration ( object ): self._chrootMode = None self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None } self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None } - self._ccbBin = None self._benchsDir = None self._masterHost = self._detectMasterHost() self._success = False @@ -377,8 +377,6 @@ class Configuration ( object ): self._srcDir = self._rootDir + '/src' self._logDir = self._srcDir + '/logs' self._yosysBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/yosysInstaller.sh' - self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh' - self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py' self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs' self._masterHost = self._detectMasterHost() return @@ -444,7 +442,7 @@ class Configuration ( object ): raise ErrorMessage( 1, [ 'Cannot find , should be here:' , ' "{}"'.format(self.alcBin) ] ) - commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) ) + commands.append( AllianceCommand( fdLog=self.fds['alliance'] ) ) if self.doCoriolis: if not os.path.isfile( self.ccbBin ): raise ErrorMessage( 1, [ 'Cannot find , should be here:' @@ -453,19 +451,9 @@ class Configuration ( object ): otherArgs = [] if self.debugArg: otherArgs.append( self.debugArg ) if target == 'EL9': - #otherArgs.append( '--project=support' ) - commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) ) - #commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) - if target == 'SL7_64': - otherArgs += [ '--project=support', '--qt4' ] - commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) ) - commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) - elif target == 'SL6_64' or target == 'SL6': - otherArgs += [ '--project=support', '--devtoolset=8', '--qt4' ] - commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) ) - commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.rootDir, 3, fdLog=self.fds['coriolis'] ) ) elif target == 'Ubuntu18' or target == 'Debian9' or target == 'Debian10': - commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) ) if self.doBenchs: commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) ) if self.doPyBenchs: