Skip to content

Commit 870c239

Browse files
author
Trevor Cickovski
committed
Merge branch 'master' of github.com:FIUBioRG/PluMA
2 parents e3a60d5 + 3471e1f commit 870c239

File tree

1 file changed

+64
-47
lines changed

1 file changed

+64
-47
lines changed

SConstruct

Lines changed: 64 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ env = Environment(
134134
CCFLAGS=["-fpermissive", "-fPIC", "-I.", "-O2"],
135135
CXXFLAGS=["-std=c++11", "-fPIC", "-O2"],
136136
CPPPATH=include_search_path,
137-
#LIBPATH=lib_search_path,
137+
LIBPATH=lib_search_path,
138138
LICENSE=["MIT"],
139139
SHLIBPREFIX=""
140140
)
@@ -226,7 +226,7 @@ else:
226226
config.CheckProg("python3-config")
227227
config.CheckProg("python3")
228228

229-
config.env.ParseConfig("/usr/bin/python3-config --includes --ldflags")
229+
config.env.ParseConfig("python3-config --includes --ldflags")
230230
config.env.Append(LIBS=["util"])
231231

232232
if sys.version_info[0] == "2":
@@ -241,11 +241,11 @@ else:
241241
logging.error("!! Could not find a valid `perl` installation`")
242242
Exit(1)
243243
else:
244-
config.env.ParseConfig("perl -MExtUtils::Embed -e ccopts -e ldopts")
244+
#config.env.ParseConfig("perl -MExtUtils::Embed -e ccopts -e ldopts")
245245

246-
if not config.CheckHeader("EXTERN.h"):
247-
logging.error("!! Could not find `EXTERN.h`")
248-
Exit(1)
246+
#if not config.CheckHeader("EXTERN.h"):
247+
# logging.error("!! Could not find `EXTERN.h`")
248+
# Exit(1)
249249

250250
config.env.AppendUnique(
251251
CXXFLAGS=["-fno-strict-aliasing"],
@@ -369,7 +369,7 @@ else:
369369
# Export `envPlugin` and `envPluginCUDA`
370370
Export("env")
371371
Export("envPluginCuda")
372-
env['CCFLAGS'].remove("-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1")
372+
#env['CCFLAGS'].remove("-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1")
373373
print(env['CCFLAGS'])
374374
###################################################################
375375
# Regenerate wrappers for plugin languages
@@ -421,31 +421,33 @@ else:
421421

422422
###################################################################
423423
# PERL PLUGINS
424-
env.SharedObject(
424+
if not env.GetOption("without-perl"):
425+
env.SharedObject(
425426
source="PerlPluMA_wrap.cxx",
426427
target=ObjectPath("PerlPluMA_wrap.os"),
427-
)
428+
)
428429

429-
env.SharedLibrary(
430+
env.SharedLibrary(
430431
source=[
431432
ObjectPath("PluMA.os"),
432433
ObjectPath("PerlPluMA_wrap.os"),
433434
],
434435
target="PerlPluMA.so",
435-
)
436+
)
436437
###################################################################
437438
# R PLUGINS
438-
env.SharedObject(
439+
if not env.GetOption("without-r"):
440+
env.SharedObject(
439441
source="RPluMA_wrap.cxx",
440442
target=ObjectPath("RPluMA_wrap.os"),
441-
)
442-
env.SharedLibrary(
443+
)
444+
env.SharedLibrary(
443445
source=[
444446
ObjectPath("PluMA.os"),
445447
ObjectPath("RPluMA_wrap.os"),
446448
],
447449
target="RPluMA.so",
448-
)
450+
)
449451
###################################################################
450452

451453
###################################################################
@@ -506,51 +508,66 @@ else:
506508

507509
for language in languages:
508510
output = language.get_path().replace("src", "obj").replace(".cxx", ".os")
509-
if "Perl" in output:
510-
env.StaticObject(
511-
LDFLAGS=[
512-
[
513-
subprocess.check_output(
514-
"perl -MExtUtils::Embed -e ldopts",
515-
universal_newlines=True,
516-
shell=True,
517-
encoding="utf8",
518-
)
519-
]
520-
],
521-
source=language,
522-
target=output,
523-
)
524-
else:
525-
env.StaticObject(
526-
source=language,
527-
target=output
528-
)
511+
#if "Perl" in output:
512+
# env.StaticObject(
513+
# LDFLAGS=[
514+
# [
515+
# subprocess.check_output(
516+
# "perl -MExtUtils::Embed -e ldopts",
517+
# universal_newlines=True,
518+
# shell=True,
519+
# encoding="utf8",
520+
# )
521+
# ]
522+
# ],
523+
# source=language,
524+
# target=output,
525+
# )
526+
#else:
527+
env.StaticObject(
528+
source=language,
529+
target=output
530+
)
529531

530532
plugenFiles = Glob(str(SourcePath("PluGen/*.cxx")))
531533

532534
env.Program("PluGen/plugen", Glob("src/PluGen/*.cxx"))
533535

534536
sourceFiles = Glob("src/*.cxx")
537+
mylibs=[
538+
"pthread",
539+
"m",
540+
"dl",
541+
"crypt",
542+
"c",
543+
"python" + python_version,
544+
"util"
545+
]
535546

547+
if not env.GetOption("without-perl"):
548+
mylibs.append("perl")
549+
if not env.GetOption("without-r"):
550+
mylibs.append("R")
551+
mylibs.append("RInside")
536552
env.Program(
537553
target="pluma",
538554
source=[
539555
SourcePath("main.cxx"),
540556
SourcePath("PluginManager.cxx"),
541557
languages,
542558
],
543-
LIBS=[
544-
"pthread",
545-
"m",
546-
"dl",
547-
"crypt",
548-
"c",
549-
"python" + python_version,
550-
"util",
551-
"perl",
552-
"R",
553-
"RInside",
554-
],
559+
LIBS = mylibs,
560+
#LIBS=[
561+
# "pthread",
562+
# "m",
563+
# "dl",
564+
# "crypt",
565+
# "c",
566+
# "python" + python_version,
567+
# "util",
568+
# "perl",
569+
# "R",
570+
# "RInside",
571+
#],
555572
)
556573
###################################################################

0 commit comments

Comments
 (0)