cbflib: new package (#21531)

This commit is contained in:
ketsubouchi 2021-02-18 18:05:32 +09:00 committed by GitHub
parent de68646c6e
commit b3e5df1049
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,17 @@
--- a/src/fcb_skip_whitespace.f90 2021-01-26 15:14:30.565029427 +0900
+++ b/src/fcb_skip_whitespace.f90 2021-01-26 15:15:01.016918388 +0900
@@ -65,11 +65,11 @@
END IF
ELSE
SELECT CASE (LINE(IC))
- CASE (Z'5C') ! backslash
+ CASE (INT(Z'5C')) ! backslash
IC = IC+1 ! force skip of next character
- CASE (Z'28') ! open paren
+ CASE (INT(Z'28')) ! open paren
COMMENT_LEVEL = COMMENT_LEVEL+1;
- CASE (Z'29') ! close paren
+ CASE (INT(Z'29')) ! close paren
COMMENT_LEVEL = COMMENT_LEVEL-1;
END SELECT
IC = IC+1;

View file

@ -0,0 +1,11 @@
--- a/src/cbf_ws.c 2021-01-26 15:31:04.793960741 +0900
+++ b/src/cbf_ws.c 2021-01-26 15:32:08.092795581 +0900
@@ -1034,7 +1034,7 @@
const char * line;
- char c, cprev, cprevprev, cprevprevprev;
+ int c, cprev, cprevprev, cprevprevprev;
size_t length;

View file

@ -0,0 +1,4 @@
#include <limits.h>
#if LONG_MAX == LLONG_MAX
#error LONG=LLONG
#endif

View file

@ -0,0 +1,43 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class Cbflib(MakefilePackage):
"""CBFLIB is a library of ANSI-C functions providing a simple mechanism
for accessing Crystallographic Binary Files (CBF files) and
Image-supporting CIF (imgCIF) files."""
homepage = "http://www.bernstein-plus-sons.com/software/CBF/"
url = "https://downloads.sourceforge.net/project/cbflib/cbflib/CBFlib_0.9.2/CBFlib-0.9.2.tar.gz"
version('0.9.2', sha256='367e37e1908a65d5472e921150291332823a751206804866e752b793bca17afc')
depends_on('m4', type='build')
patch('cbf_f16.patch')
patch('cbf_int.patch')
def setup_build_environment(self, env):
ce = Executable(self.compiler.cc)
ce('-E', join_path(os.path.dirname(__file__), "checkint.c"),
output=str, error=str, fail_on_error=False)
if ce.returncode != 0:
env.set('CBF_DONT_USE_LONG_LONG', '1')
def edit(self, spec, prefix):
mf = FileFilter('Makefile')
mf.filter(r'^CC.+', "CC = {0}".format(spack_cc))
mf.filter(r'^C\+\+.+', "C++ = {0}".format(spack_cxx))
mf.filter('gfortran', spack_fc)
mf.filter(r'^INSTALLDIR .+', "INSTALLDIR = {0}".format(prefix))
def build(self, spec, prefix):
pass
def install(self, spec, prefix):
make('install', parallel=False)