forked from iLCSoft/iLCInstall
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eigen.py
72 lines (53 loc) · 2.45 KB
/
eigen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
##################################################
#
# Eigen module
# needs eigen to be installed on the system
# just checks if header files are there
#
# Author: F.Gaede, DESY/CERN
# Date: Sep 2016
#
##################################################
# custom imports
from .baseilc import BaseILC
from .util import *
class Eigen(BaseILC):
""" Responsible for the Eigen configuration process. """
def __init__(self, userInput):
BaseILC.__init__(self, userInput, "Eigen", "eigen")
# technically possible but set this to false
self.download.supportHEAD = False
self.hasCMakeBuildSupport = True
self.reqmodules = [ "CMake" ]
self.download.supportedTypes = [ "wget" ]
# self.download.server = "gitlab.com"
# self.download.gituser = 'eigenteam'
# self.download.gitrepo = 'libeigen'
self.reqfiles = [
["include/eigen3/Eigen/src/Core/Matrix.h", "include/eigen3/Eigen/Core",
"Eigen/src/Core/Matrix.h", "Eigen/Core" ]
]
def setMode(self, mode):
BaseILC.setMode(self, mode)
if( self.mode == "install" ):
# Example: https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
self.download.url = "https://gitlab.com/libeigen/eigen/-/archive/%s/eigen-%s.tar.gz" % (self.version, self.version.replace( "." , "_" ) )
# installPath does not exists before setMode is called
self.cmakeconfig = self.installPath + "/share/eigen3/cmake/"
def compile(self):
""" compile Eigen """
trymakedir( self.buildPath )
os.chdir( self.buildPath )
self.envcmake["CMAKE_INSTALL_PREFIX"] = self.installPath
if( self.rebuild ):
tryunlink( "CMakeCache.txt" )
# build software
if( os_system( self.genCMakeCmd() + " 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to configure!!" )
if( os_system( ". ../build_env.sh ; make install 2>&1 | tee -a " + self.logfile ) != 0 ):
self.abort( "failed to install!!" )
def preCheckDeps(self):
pass
def postCheckDeps(self):
BaseILC.postCheckDeps(self)
self.addCMakeCache( "EIGEN3_DIR", self.installPath, "Path to Eigen3" )