/ src / fast / SConscript
SConscript
 1  #
 2  # Copyright (C) 2018-2020, Advanced Micro Devices. All rights Reserved
 3  #
 4  # Redistribution and use in source and binary forms, with or without modification,
 5  # are permitted provided that the following conditions are met:
 6  # 1. Redistributions of source code must retain the above copyright notice,
 7  #    this list of conditions and the following disclaimer.
 8  # 2. Redistributions in binary form must reproduce the above copyright notice,
 9  #    this list of conditions and the following disclaimer in the documentation
10  #    and/or other materials provided with the distribution.
11  # 3. Neither the name of the copyright holder nor the names of its contributors
12  #    may be used to endorse or promote products derived from this software without
13  #    specific prior written permission.
14  #
15  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
19  # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21  # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22  # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24  # POSSIBILITY OF SUCH DAMAGE.
25  
26  # Inherit global environment
27  Import('env')
28  from os.path import join as joinpath
29  
30  e = env.Clone()
31  
32  incpaths = [
33  	Dir('#/src/optmized/'),
34   ]
35  
36  
37  e.Append(
38      CCFLAGS = [
39          #'-Wall', '-W', '-Wstrict-prototypes', '-Werror',
40          #'-Wno-unused-but-set-parameter',
41          #'-Wno-unused-parameter', '-O3',
42          #'-fPIC',
43          '-mavx2', '-march=znver2'
44      ],
45      CPPPATH = incpaths,
46      # CCFLAGS = [],
47      # LINKFLAGS = ['-T$LINKERSCRIPT'],
48      LINKERSCRIPT = 'src/ld-syms-libm.lds',
49      STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME = 1
50  )
51  
52  excluded_srcs = []
53  
54  fast_srcs = Glob('*.c', exclude=excluded_srcs)
55  fast_srcs += Glob('_exp_data.c')
56  
57  fast_objs = e.StaticObject(fast_srcs)
58  
59  #print('lib sources' , list(source))
60  
61  almfast = e.StaticLibrary('almfast', fast_objs)
62  almfastso = e.SharedLibrary('almfast', fast_objs)
63  
64  Return('almfast', 'almfastso')
65