summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/openssl/package.py
diff options
context:
space:
mode:
authorJared Popelar <jpopelar@txcorp.com>2021-05-17 14:56:42 -0600
committerPeter Scheibel <scheibel1@llnl.gov>2022-03-17 09:01:01 -0700
commit15ef85e161f84ae199ee773732b230ccafc665c7 (patch)
tree9b468ab5a491639d733664b8b3ae95f20df93a99 /var/spack/repos/builtin/packages/openssl/package.py
parent012758c1796577845a98981bd950ef9513d13a14 (diff)
downloadspack-15ef85e161f84ae199ee773732b230ccafc665c7.tar.gz
spack-15ef85e161f84ae199ee773732b230ccafc665c7.tar.bz2
spack-15ef85e161f84ae199ee773732b230ccafc665c7.tar.xz
spack-15ef85e161f84ae199ee773732b230ccafc665c7.zip
Packaging of netlib-lapack for windows (#24993)
MSVC's internal CMake and Ninja now detected by spack external find and added to packages.yaml Saving progress on packaging zlib for Windows Fixing the shared CMake flag * Loading Intel's ifx Fortran compiler into MSVC; if there are multiple versions of MSVC installed and detected, ifx will only be placed into the first block written in compilers.yaml. The version number of ifx can be detected using MSVC's version flag (instead of /QV) by using ignore_version_errors. This commit also provides support for detection of Intel compilers in their own compiler block by adding ifx.exe to the fc/f77_name blocks inside intel.py * Giving CMake a Fortran compiler argument * Adding patch file for removing duplicated mangling header for versions 3.9.1 and older; static and shared now successfully building on Windows * Have netlib-lapack depend on ninja@1.10 Co-authored-by: John R. Cary <cary@txcorp.com> Co-authored-by: Jared Popelar <jpopelar@txcorp.com> Making a default config.yaml for Windows Small path length for build_stage Provide more prerequisite details, mention default config.yaml Killing an unnecessary setvars call Replacing some lost changes, proofreading, updating windows-supported package list Co-authored-by: John Parent <john.parent@kitware.com>
Diffstat (limited to 'var/spack/repos/builtin/packages/openssl/package.py')
-rw-r--r--var/spack/repos/builtin/packages/openssl/package.py59
1 files changed, 50 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/openssl/package.py b/var/spack/repos/builtin/packages/openssl/package.py
index b4fe7ec425..f21b6b81a8 100644
--- a/var/spack/repos/builtin/packages/openssl/package.py
+++ b/var/spack/repos/builtin/packages/openssl/package.py
@@ -89,6 +89,8 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
description=('Use certificates from the ca-certificates-mozilla '
'package, symlink system certificates, or none'))
variant('docs', default=False, description='Install docs and manpages')
+ variant('shared', default=False, description="Build shared library version")
+ variant('dynamic', default=False, description="Link with MSVC's dynamic runtime library")
depends_on('zlib')
depends_on('perl@5.14.0:', type=('build', 'test'))
@@ -134,26 +136,65 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
if self.spec.satisfies('%nvhpc os=centos7'):
options.append('-D__STDC_NO_ATOMICS__')
- config = Executable('./config')
- config('--prefix=%s' % prefix,
- '--openssldir=%s' % join_path(prefix, 'etc', 'openssl'),
- '-I{0}'.format(self.spec['zlib'].prefix.include),
- '-L{0}'.format(self.spec['zlib'].prefix.lib),
- *options)
+ # Make a flag for shared library builds
+ shared_flag = ''
+ if spec.satisfies('~shared'):
+ shared_flag = 'no-shared'
+
+ # On Windows, we use perl for configuration and build through MSVC
+ # nmake.
+ if spec.satisfies('platform=windows'):
+ config = Executable('perl')
+ config('Configure',
+ '--prefix=%s' % prefix,
+ '--openssldir=%s' % join_path(prefix, 'etc', 'openssl'),
+ 'CC=\"%s\"' % os.environ.get('SPACK_CC'),
+ 'CXX=\"%s\"' % os.environ.get('SPACK_CXX'),
+ '%s' % shared_flag,
+ 'VC-WIN64A')
+ else:
+ config = Executable('./config')
+ config('--prefix=%s' % prefix,
+ '--openssldir=%s' % join_path(prefix, 'etc', 'openssl'),
+ '-I{0}'.format(self.spec['zlib'].prefix.include),
+ '-L{0}'.format(self.spec['zlib'].prefix.lib),
+ *options)
# Remove non-standard compiler options if present. These options are
# present e.g. on Darwin. They are non-standard, i.e. most compilers
# (e.g. gcc) will not accept them.
filter_file(r'-arch x86_64', '', 'Makefile')
- make()
+ if spec.satisfies('+dynamic'):
+ # This variant only makes sense for Windows
+ if spec.satisfies('platform=windows'):
+ filter_file(r'MT', 'MD', 'makefile')
+ else:
+ tty.warn("Dynamic runtime builds are only available for "
+ "Windows operating systems. Please disable "
+ "+dynamic to suppress this warning.")
+
+ if spec.satisfies('platform=windows'):
+ nmake = Executable('nmake')
+ nmake()
+ else:
+ make()
+
if self.run_tests:
- make('test', parallel=False) # 'VERBOSE=1'
+ if spec.satisfies('platform=windows'):
+ nmake = Executable('nmake')
+ nmake('test', parallel=False)
+ else:
+ make('test', parallel=False) # 'VERBOSE=1'
install_tgt = 'install' if self.spec.satisfies('+docs') else 'install_sw'
# See https://github.com/openssl/openssl/issues/7466#issuecomment-432148137
- make(install_tgt, parallel=False)
+ if spec.satisfies('platform=windows'):
+ nmake = Executable('nmake')
+ nmake(install_tgt, parallel=False)
+ else:
+ make(install_tgt, parallel=False)
@run_after('install')
def link_system_certs(self):