sib-swiss / pftools3

A suite of tools to build and search generalized profiles
GNU General Public License v2.0
10 stars 7 forks source link

Error compiling on OSX #24

Open Juke34 opened 2 years ago

Juke34 commented 2 years ago

building info:

cmake -DSTANDALONE=ON ..
-- +--------------------------------------------------------------------+
-- |                          PfTools   v3.2.10                          |
-- +--------------------------------------------------------------------+
-- |     (C) Copyright SIB Swiss Institute of Bioinformatics            |
-- |         Thierry Schuepbach (projects@vital-it.ch)                  |
-- |                                                                    |
-- |     PfTools is available from                                      |
-- |         https://github.com/sib-swiss/pftools3                      |
-- |     under the GPL v2. See LICENSE.                                 |
-- |                                                                    |
-- +--------------------------------------------------------------------+
-- Compilation on architecture x86_64.
-- testing flag -msse4.1...
-- Add -std=c99 to C compiler options
-- Add SSE2 to C compiler options
-- Perl found - full test suite usable
-- libPCRE will be built in /Users/jacda119/git/pftools3/build/libPCRE
-- Building test suite for pfsearch in /Users/jacda119/git/pftools3/Tests
-- Check Perl script syntax
       compare_2_profiles.pl
           - syntax OK
       fasta_to_fastq.pl
           - syntax OK
       make_iupac_cmp.pl
           - syntax OK
       ps_scan.pl
           - syntax OK
       scramble_fasta.pl
           - syntax OK
       sort_fasta.pl
           - syntax OK
       split_profile_file.pl
           - syntax OK
-- 
-- PfTools Software Suite configuration summary:
-- 
--   System name ......................: Darwin
--   Build type .......................: Release
-- 
--   Integer format ...................: 16 bits
-- 
--   Install prefix .................. : /usr/local
--   C compiler ...................... : /Users/jacda119/miniconda3/envs/pftools/bin/x86_64-apple-darwin13.4.0-clang
--   Fortran compiler ................ : /Users/jacda119/miniconda3/envs/pftools/bin/x86_64-apple-darwin13.4.0-gfortran
--   C compiler flags ................ : -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/jacda119/miniconda3/envs/pftools/include -std=c99 -msse2 -O3 -DNDEBUG
--   C compiler SSE2 flag. ........... : -msse2
--   C compiler SSE 4.1 flag.......... : -msse4.1
--   Fortran compiler flags .......... : -march=core2 -mtune=haswell -ftree-vectorize -fPIC -fstack-protector -O2 -pipe -isystem /Users/jacda119/miniconda3/envs/pftools/include -O3 -DNDEBUG -O3
-- 
--   Use file memory mapping ..........: ON
--   Use thread affinity setting ......: OFF
-- 
--   Build shared libs ............... : OFF
--   Build static libs ............... : OFF
--   Build static executables......... : ON
-- 
--   Link with pcre .................. : Internaly built
-- 
!! CPU thread affinity is disabled, hence performance penalty may apply on many-core architecture.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jacda119/git/pftools3/build

compiling with make:

[ 33%] Built target SEQUENCES_EXTRA
[ 34%] Building C object src/C/utils/CMakeFiles/SEQUENCES.dir/ReadSequence.c.o
/Users/jacda119/git/pftools3/src/C/utils/ReadSequence.c:213:36: error: no member named 'st_mtim' in 'struct stat'
        Info->LastModification = FileStat.st_mtim;
                                 ~~~~~~~~ ^
/Users/jacda119/git/pftools3/src/C/utils/ReadSequence.c:423:36: error: no member named 'st_mtim' in 'struct stat'
        Info->LastModification = FileStat.st_mtim;
                                 ~~~~~~~~ ^
/Users/jacda119/git/pftools3/src/C/utils/ReadSequence.c:571:36: error: no member named 'st_mtim' in 'struct stat'
        Info->LastModification = FileStat.st_mtim;
                                 ~~~~~~~~ ^
/Users/jacda119/git/pftools3/src/C/utils/ReadSequence.c:631:41: error: no member named 'st_mtim' in 'struct stat'
        if (st.st_size != Info->FileSize || st.st_mtim.tv_nsec != Info->LastModification.tv_nsec ||
                                            ~~ ^
/Users/jacda119/git/pftools3/src/C/utils/ReadSequence.c:632:6: error: no member named 'st_mtim' in 'struct stat'
                st.st_mtim.tv_sec != Info->LastModification.tv_sec) {
                ~~ ^
5 errors generated.
make[2]: *** [src/C/utils/CMakeFiles/SEQUENCES.dir/ReadSequence.c.o] Error 1
make[1]: *** [src/C/utils/CMakeFiles/SEQUENCES.dir/all] Error 2
make: *** [all] Error 2
Juke34 commented 2 years ago

adding

#if defined(__APPLE__) || defined(__NetBSD__) 
#define st_atim st_atimespec
#define st_ctim st_ctimespec
#define st_mtim st_mtimespec
#endif

in the header of ReadSequence.c solve the problem but now I have another problem

Consolidate compiler generated dependencies of target SYSTEM
[ 36%] Building C object src/C/utils/CMakeFiles/SYSTEM.dir/system.c.o
In file included from /Users/jacda119/git/pftools3/src/C/utils/system.c:11:
/Users/jacda119/git/pftools3/src/C/include/system.h:90:32: error: unknown type name 'cpu_set_t'
typedef struct Affinity_Mask { cpu_set_t data; } Affinity_Mask_t;
                               ^
1 error generated.
make[2]: *** [src/C/utils/CMakeFiles/SYSTEM.dir/system.c.o] Error 1
make[1]: *** [src/C/utils/CMakeFiles/SYSTEM.dir/all] Error 2
make: *** [all] Error 2
schoopy commented 2 years ago

From what I remember, OSX should be recognized and Affinity deactivated. I will have a look at this and come back to you.

Thierry

Sent from MailDroid

-----Original Message----- From: Jacques Dainat @.> To: sib-swiss/pftools3 @.> Cc: Subscribed @.***> Sent: Tue, 12 Oct 2021 10:50 AM Subject: Re: [sib-swiss/pftools3] Error compiling on OSX (#24)

adding

#if defined(__APPLE__) || defined(__NetBSD__) 
#define st_atim st_atimespec
#define st_ctim st_ctimespec
#define st_mtim st_mtimespec
#endif

in the header of ReadSequence.c solve the problem but now I have another problem

Consolidate compiler generated dependencies of target SYSTEM
[ 36%] Building C object src/C/utils/CMakeFiles/SYSTEM.dir/system.c.o
In file included from /Users/jacda119/git/pftools3/src/C/utils/system.c:11:
/Users/jacda119/git/pftools3/src/C/include/system.h:90:32: error: unknown type name 'cpu_set_t'
typedef struct Affinity_Mask { cpu_set_t data; } Affinity_Mask_t;
                               ^
1 error generated.
make[2]: *** [src/C/utils/CMakeFiles/SYSTEM.dir/system.c.o] Error 1
make[1]: *** [src/C/utils/CMakeFiles/SYSTEM.dir/all] Error 2
make: *** [all] Error 2

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/sib-swiss/pftools3/issues/24#issuecomment-940802494