Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ask about compiling on arm. #12

Open
yangxingyu588 opened this issue Sep 11, 2023 · 17 comments
Open

ask about compiling on arm. #12

yangxingyu588 opened this issue Sep 11, 2023 · 17 comments

Comments

@yangxingyu588
Copy link

hi @martin-g @Yikun .What l do now is to use bioconda-utils to build bioconda community software, such as bwa, ac-diamond, etc. l have no foundation, and l often encounter some makefile and cmake problems. l would like to ask what can be referred to in this respect to get started quickly. Thank you very much for your advice.
ln addition

  1. Why is bwa problem solved in this pr? What is the idea of modifying these modified files? l'd like to learn.
  2. Is there any idea to solve mistake like this.
    cmd is bioconda-utils build --packages ac-diamond
...
INFO:conda_build.source:Source cache directory is: /root/anaconda3/envs/kallisto/conda-bld/src_cache
Source cache directory is: /root/anaconda3/envs/kallisto/conda-bld/src_cache
INFO:conda_build.source:Downloading source to cache: v1.0_f3ee403390.tar.gz
Downloading source to cache: v1.0_f3ee403390.tar.gz
Downloading https://github.com/Maihj/AC-DIAMOND/archive/v1.0.tar.gz
INFO:conda_build.source:Downloading https://github.com/Maihj/AC-DIAMOND/archive/v1.0.tar.gz
Success
INFO:conda_build.source:Success
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Error at /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/_build_env/share/cmake-3.27/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/_build_env/bin/aarch64-conda-linux-gnu-c++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/work/build/CMakeFiles/CMakeScratch/TryCompile-qpPxPt'

    Run Build Command(s): /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/_build_env/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_d0ce2/fast
    /usr/bin/gmake  -f CMakeFiles/cmTC_d0ce2.dir/build.make CMakeFiles/cmTC_d0ce2.dir/build
    gmake[1]: Entering directory '/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/work/build/CMakeFiles/CMakeScratch/TryCompile-qpPxPt'
    Building CXX object CMakeFiles/cmTC_d0ce2.dir/testCXXCompiler.cxx.o
    /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/_build_env/bin/aarch64-conda-linux-gnu-c++   -fvisibility-inlines-hidden -fmessage-length=0 -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include -fdebug-prefix-map=/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/work=/usr/local/src/conda/ac-diamond-1.0 -fdebug-prefix-map=/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla=/usr/local/src/conda-prefix -msse4.1  -o CMakeFiles/cmTC_d0ce2.dir/testCXXCompiler.cxx.o -c /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/work/build/CMakeFiles/CMakeScratch/TryCompile-qpPxPt/testCXXCompiler.cxx
    aarch64-conda-linux-gnu-c++: error: unrecognized command-line option '-msse4.1'
    gmake[1]: *** [CMakeFiles/cmTC_d0ce2.dir/build.make:78: CMakeFiles/cmTC_d0ce2.dir/testCXXCompiler.cxx.o] Error 1
    gmake[1]: Leaving directory '/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1694435828815/work/build/CMakeFiles/CMakeScratch/TryCompile-qpPxPt'
    gmake: *** [Makefile:127: cmTC_d0ce2/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


Extracting download
...
@martin-g
Copy link
Contributor

martin-g commented Sep 11, 2023

I often encounter some makefile and cmake problems. l would like to ask what can be referred to in this respect to get started quickly

You can contact me in Slack or here when you face a problem and I will try to help you resolve it!

  1. What is the idea of modifying these modified files?

The idea is to use more CPU registers simultaneously. By using Neon (for aarch64) and AVX (for 86_64) you can process more data with a single CPU instruction. For example if you have an array of integers and you want to get the sum of them then normally you would use an accumulator (arr[0]) and add to it arr[1], then to the result add arr[2], and so on. Each addition operation would be one CPU cycle.

By using SIMD (single instruction - multiple data) you can use several CPU registers for one CPU cycle. For example the accumulator will be the sum of arr[0]+arr[1]+arr[2]+arr[3], then the result will be increased with arr[4]+arr[5]+arr[6]+arr[7], etc.

-msse4.1 is a C++ compiler flag to use x86_64 specific instructions. Since you run the build on an aarch64 hardware the C++ compiler complains that it does not support this option.
You/we will need to report the issue to ac_diamond project. Currently it does not support aarch4 ...

@yangxingyu588
Copy link
Author

Hi, Thank you very much. Here are some questions I'll sort out.
Like question one, are neon_sse.h and scalar_sse.h standard files, where can l find them, and how can l think of adding them?
question two, Can we only wait for the project to solve the problem, If the local verifications is successful after the modification, submit the code to the community.

@yangxingyu588
Copy link
Author

The error information is too few to I can see the cause. Would you mind to point out this problem? This is the error report when I use bioconda-utils to build bioconductor-msa.

<command-line>: note: this is the location of the previous definition
/root/anaconda3/envs/bioconductor/conda-bld/bioconductor-msa_1694484704882/_build_env/bin/../lib/gcc/aarch64-conda-linux-gnu/10.4.0/../../../../aarch64-conda-linux-gnu/bin/ld: clustal-omega.o: in function `AlnToHHMFile':
clustal-omega.c:(.text+0x668): warning: the use of `mktemp' is dangerous, better use `mkstemp'
/root/anaconda3/envs/bioconductor/conda-bld/bioconductor-msa_1694484704882/_build_env/bin/../lib/gcc/aarch64-conda-linux-gnu/10.4.0/../../../../aarch64-conda-linux-gnu/bin/ld: ./libClustalW.a(Iteration.o): in function `clustalw::Iteration::removeFirstIterate(clustalw::Alignment*)':
Iteration.cpp:(.text+0x1814): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/root/anaconda3/envs/bioconductor/conda-bld/bioconductor-msa_1694484704882/_build_env/bin/../lib/gcc/aarch64-conda-linux-gnu/10.4.0/../../../../aarch64-conda-linux-gnu/bin/ld: ./libClustalOmega.a(clustal-omega.o): in function `AlnToHHMFile':
clustal-omega.c:(.text+0x668): warning: the use of `mktemp' is dangerous, better use `mkstemp'
installing to /root/anaconda3/envs/bioconductor/conda-bld/bioconductor-msa_1694484704882/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/R/library/00LOCK-work/00new/msa/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
ERROR: loading failed
* removing ‘/root/anaconda3/envs/bioconductor/conda-bld/bioconductor-msa_1694484704882/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/R/library/msa’
$BUILD_PREFIX/bin/aarch64-conda-linux-gnu-c++ -I"$PREFIX/lib/R/include" -DNDEBUG  -I'$PREFIX/lib/R/library/Rcpp/include' -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem $PREFIX/include -I$PREFIX/include -Wl,-rpath-link,$PREFIX/lib      -std=c++98 -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-8.2.2/include -fPIC  -fvisibility-inlines-hidden  -fmessage-length=0 -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem $PREFIX/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1689933299373/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -c RClustalOmega.cpp -o RClustalOmega.o
$BUILD_PREFIX/bin/aarch64-conda-linux-gnu-cc -I"$PREFIX/lib/R/include" -DNDEBUG  -I'$PREFIX/lib/R/library/Rcpp/include' -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem $PREFIX/include -I$PREFIX/include -Wl,-rpath-link,$PREFIX/lib     -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-8.2.2/include -fPIC  -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem $PREFIX/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1689933299373/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -c mymain.c -o mymain.o
$BUILD_PREFIX/bin/aarch64-conda-linux-gnu-cc -I"$PREFIX/lib/R/include" -DNDEBUG  -I'$PREFIX/lib/R/library/Rcpp/include' -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem $PREFIX/include -I$PREFIX/include -Wl,-rpath-link,$PREFIX/lib     -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I../../gc-8.2.2/include -fPIC  -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem $PREFIX/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1689933299373/work=/usr/local/src/conda/r-base-4.3.1 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix  -c clustal-omega.c -o clustal-omega.o
$BUILD_PREFIX/bin/aarch64-conda-linux-gnu-c++ -shared -L$PREFIX/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--allow-shlib-undefined -Wl,-rpath,$PREFIX/lib -Wl,-rpath-link,$PREFIX/lib -L$PREFIX/lib -o libClustalOmega.so exceptions4c/e4c_lite.o argtable2/argtable2.o argtable2/arg_end.o argtable2/arg_rem.o argtable2/arg_lit.o argtable2/arg_int.o argtable2/arg_dbl.o argtable2/arg_str.o argtable2/arg_file.o kmpp/KMeans.o kmpp/KmTree.o kmpp/KmUtils.o clustal/hhalign_wrapper.o clustal/ktuple_pair.o clustal/list.o clustal/log.o clustal/muscle_upgma.o clustal/muscle_tree.o clustal/mbed.o clustal/pair_dist.o clustal/progress.o clustal/seq.o clustal/symmatrix.o clustal/tree.o clustal/util.o clustal/weights.o squid/a2m.o squid/aligneval.o squid/alignio.o squid/clustal.o squid/cluster.o squid/dayhoff.o squid/eps.o squid/file.o squid/getopt.o squid/gki.o squid/gsi.o squid/gsi64.o squid/hsregex.o squid/iupac.o squid/msa.o squid/msf.o squid/phylip.o squid/revcomp.o squid/rk.o squid/selex.o squid/seqencode.o squid/shuffle.o squid/sqerror.o squid/sqio.o squid/squidcore.o squid/sre_ctype.o squid/sre_math.o squid/sre_random.o squid/sre_string.o squid/ssi.o squid/stack.o squid/stockholm.o squid/stopwatch.o squid/translate.o squid/types.o squid/vectorops.o squid/weight.o hhalign/hhalign.o RClustalOmega.o mymain.o clustal-omega.o -L$PREFIX/lib/R/lib -lR
make[2]: Leaving directory '$SRC_DIR/src/ClustalOmega/src'
make[1]: Leaving directory '$SRC_DIR/src/ClustalOmega'
----------------------------------------
------------- ClustalOmega -------------
----------------------------------------
--------- Compilation finished ---------
----------------------------------------
$BUILD_PREFIX/bin/aarch64-conda-linux-gnu-c++ -shared -L$PREFIX/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--allow-shlib-undefined -Wl,-rpath,$PREFIX/lib -Wl,-rpath-link,$PREFIX/lib -L$PREFIX/lib -o msa.so R_init_msa.o SplitCharVector2List.o SplitCharVector2Matrix.o -Wl,--whole-archive ./libgc.a ./libClustalW.a ./libClustalOmega.a ./libMuscle.a -Wl,--no-whole-archive -L$PREFIX/lib/R/lib -lR
Error: package or namespace load failed for ‘msa’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '$PREFIX/lib/R/library/00LOCK-work/00new/msa/libs/msa.so':
  $PREFIX/lib/R/library/00LOCK-work/00new/msa/libs/msa.so: undefined symbol: pthread_atfork
Error: loading failed
Execution halted

@martin-g
Copy link
Contributor

Like question one, are neon_sse.h and scalar_sse.h standard files, where can l find them, and how can l think of adding them?

No. These files were custom implementation by the PR author.
The standard ones are:

Here is a PR that uses sse2neon - lbcb-sci/graphmap2#23

question two, Can we only wait for the project to solve the problem, If the local verifications is successful after the modification, submit the code to the community.

If you know how to make the improvements then it is better to send a Pull Request!

@martin-g
Copy link
Contributor

The error is msa.so: undefined symbol: pthread_atfork. That means the compilation command needs -lpthread

https://bioconductor.org/checkResults/3.18/bioc-LATEST/msa/kunpeng2-checksrc.html uses -lpthread here:

libtool: compile:  gcc -DHAVE_CONFIG_H -I./include -I./include -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -Wno-frame-address -MT fnlz_mlc.lo -MD -MP -MF .deps/fnlz_mlc.Tpo -c fnlz_mlc.c  -fPIC -DPIC -o fnlz_mlc.o
/bin/sh ./libtool  --tag=CC   --mode=link gcc   -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -Wno-frame-address   -version-info 6:1:5 -no-undefined  -o libgc.la -rpath /usr/local/lib allchblk.lo alloc.lo blacklst.lo dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo headers.lo mach_dep.lo malloc.lo mallocx.lo mark.lo mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo ptr_chck.lo reclaim.lo specific.lo typd_mlc.lo  pthread_start.lo pthread_support.lo  pthread_stop_world.lo thread_local_alloc.lo   gcj_mlc.lo fnlz_mlc.lo  -lpthread -ldl   

@martin-g
Copy link
Contributor

@yangxingyu588 Let's use Disccussions instead. It supports threading and it will be easier to follow the questions and their answers.

@yangxingyu588
Copy link
Author

@yangxingyu588 Let's use Disccussions instead. It supports threading and it will be easier to follow the questions and their answers.

Thank you, but l can't open this page:https://github.com/bio-arm/bio-arm.github.io/discussions

@yangxingyu588
Copy link
Author

The error is msa.so: undefined symbol: pthread_atfork. That means the compilation command needs -lpthread

https://bioconductor.org/checkResults/3.18/bioc-LATEST/msa/kunpeng2-checksrc.html uses -lpthread here:

libtool: compile:  gcc -DHAVE_CONFIG_H -I./include -I./include -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -Wno-frame-address -MT fnlz_mlc.lo -MD -MP -MF .deps/fnlz_mlc.Tpo -c fnlz_mlc.c  -fPIC -DPIC -o fnlz_mlc.o
/bin/sh ./libtool  --tag=CC   --mode=link gcc   -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -fno-strict-aliasing -Wno-frame-address   -version-info 6:1:5 -no-undefined  -o libgc.la -rpath /usr/local/lib allchblk.lo alloc.lo blacklst.lo dbg_mlc.lo dyn_load.lo finalize.lo gc_dlopen.lo headers.lo mach_dep.lo malloc.lo mallocx.lo mark.lo mark_rts.lo misc.lo new_hblk.lo obj_map.lo os_dep.lo ptr_chck.lo reclaim.lo specific.lo typd_mlc.lo  pthread_start.lo pthread_support.lo  pthread_stop_world.lo thread_local_alloc.lo   gcj_mlc.lo fnlz_mlc.lo  -lpthread -ldl   

What should l do to resolve it.
l tried to add LIBS=-lpthread to the ./R/Makevars file, but it still reports the same error.
This is the build.sh file.

#!/bin/bash
mv DESCRIPTION DESCRIPTION.old
grep -v '^Priority: ' DESCRIPTION.old > DESCRIPTION
mkdir -p ~/.R
echo -e "CC=$CC
FC=$FC
CXX=$CXX
CXX98=$CXX
CXX11=$CXX
CXX14=$CXX
LIBS=-lpthread"> ~/.R/Makevars
$R CMD INSTALL --build .

@martin-g
Copy link
Contributor

See #14

@martin-g
Copy link
Contributor

@yangxingyu588 About AC-DIAMOND: Maihj/AC-DIAMOND#8

@yangxingyu588
Copy link
Author

@yangxingyu588 About AC-DIAMOND: Maihj/AC-DIAMOND#8

Hi@martin, I use bioconda-utils build --packages ac-diamond to build ac-diamond
and use the source which you have changed
and -msse4.1 is deleted from build.sh, as
-DCMAKE_CXX_FLAGS="${CXXFLAGS}"

However, the build still fails and there are few error messages, could you please help me solve the problem?

/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../output/../basic/score_matrix.h:168:16: error: 'constexpr' does not name a type
  168 |         static constexpr double LN_2 = 0.69314718055994530941723212145818;
      |                ^~~~~~~~~
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../output/../basic/score_matrix.h:168:16: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../output/../basic/score_matrix.h: In member function 'double score_matrix::bitscore(int) const':
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../output/../basic/score_matrix.h:143:61: error: 'LN_2' was not declared in this scope
  143 |         { return ( sb_.lambda() * raw_score - sb_.ln_k()) / LN_2; }
      |                                                             ^~~~
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../output/../basic/score_matrix.h: In member function 'double score_matrix::rawscore(double, double) const':
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../output/../basic/score_matrix.h:146:28: error: 'LN_2' was not declared in this scope
  146 |         { return (bitscore*LN_2 + sb_.ln_k()) / sb_.lambda(); }
      |                            ^~~~
In file included from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../search/align.h:45,
                 from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/master_thread.h:49:
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../search/../search/sse_dist.h: In function '__m128i reduce_seq_ssse3(const __m128i&)':
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../search/../search/sse_dist.h:167:1: warning: no return statement in function returning non-void [-Wreturn-type]
  167 | }
      | ^
In file included from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/sequence.h:25,
                 from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/sequence_set.h:44,
                 from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/reference.h:50,
                 from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/main.cpp:44:
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value.h: In instantiation of 'Char_representation<_val>::Char_representation(unsigned int, const char*, char, const char*) [with _val = Value_type<Letter_prot>]':
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value.h:105:194:   required from here
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value.h:63:23: warning: 'void* memset(void*, int, size_t)' writing to an object of non-trivial type 'struct Value_type<Letter_prot>'; use assignment instead [-Wclass-memaccess]
   63 |                 memset(data_, invalid, sizeof(data_));
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value.h:24:
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value_type.h:28:8: note: 'struct Value_type<Letter_prot>' declared here
   28 | struct Value_type
      |        ^~~~~~~~~~
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value.h: In instantiation of 'Char_representation<_val>::Char_representation(unsigned int, const char*, char, const char*) [with _val = Value_type<Letter_nucl>]':
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value.h:122:203:   required from here
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value.h:63:23: warning: 'void* memset(void*, int, size_t)' writing to an object of non-trivial type 'struct Value_type<Letter_nucl>'; use assignment instead [-Wclass-memaccess]
   63 |                 memset(data_, invalid, sizeof(data_));
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/data/../basic/../basic/value_type.h:28:8: note: 'struct Value_type<Letter_nucl>' declared here
   28 | struct Value_type
      |        ^~~~~~~~~~
In file included from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_read.h:30,
                 from /root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_queries.h:27
.
.
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_sequence.h: In instantiation of 'void align_sequence(std::vector<Segment<_val> >&, Statistics&, std::vector<local_match<_val> >&, unsigned int*, size_t, unsigned int, typename Trace_pt_buffer<_locr, _locl>::Vector::iterator&, typename Trace_pt_buffer<_locr, _locl>::Vector::iterator&, std::vector<char>&) [with _val = Value_type<Letter_prot>; _locr = unsigned int; _locl = unsigned int; size_t = long unsigned int; typename Trace_pt_buffer<_locr, _locl>::Vector::iterator = std::vector<hit<unsigned int, unsigned int>, std::allocator<hit<unsigned int, unsigned int> > >::iterator; typename Trace_pt_buffer<_locr, _locl>::Vector = std::vector<hit<unsigned int, unsigned int>, std::allocator<hit<unsigned int, unsigned int> > >]':
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_read.h:67:36:   required from 'void align_read(Output_buffer<_val>&, Statistics&, typename Trace_pt_buffer<_locr, _locl>::Vector::iterator&, typename Trace_pt_buffer<_locr, _locl>::Vector::iterator&) [with _val = Value_type<Letter_prot>; _locr = unsigned int; _locl = unsigned int; typename Trace_pt_buffer<_locr, _locl>::Vector::iterator = std::vector<hit<unsigned int, unsigned int>, std::allocator<hit<unsigned int, unsigned int> > >::iterator; typename Trace_pt_buffer<_locr, _locl>::Vector = std::vector<hit<unsigned int, unsigned int>, std::allocator<hit<unsigned int, unsigned int> > >]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_queries.h:57:32:   required from 'void align_queries(typename Trace_pt_list<_locr, _locl>::iterator, typename Trace_pt_list<_locr, _locl>::iterator, Output_buffer<_val>&, Statistics&) [with _val = Value_type<Letter_prot>; _locr = unsigned int; _locl = unsigned int; unsigned int _d = 6; typename Trace_pt_list<_locr, _locl>::iterator = std::vector<hit<unsigned int, unsigned int>, std::allocator<hit<unsigned int, unsigned int> > >::iterator]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_queries.h:82:39:   required from 'void Align_context<_val, _locr, _locl, _buffer>::operator()(unsigned int) [with _val = Value_type<Letter_prot>; _locr = unsigned int; _locl = unsigned int; _buffer = Temp_output_buffer<Value_type<Letter_prot> >]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../data/../util/thread.h:61:47:   required from 'void pool_worker(void*) [with _context = Align_context<Value_type<Letter_prot>, unsigned int, unsigned int, Temp_output_buffer<Value_type<Letter_prot> > >]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../data/../util/thread.h:73:15:   required from 'void launch_thread_pool(_context&, unsigned int) [with _context = Align_context<Value_type<Letter_prot>, unsigned int, unsigned int, Temp_output_buffer<Value_type<Letter_prot> > >]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_queries.h:118:23:   required from 'void align_queries(const Trace_pt_buffer<_locr, _locl>&, Output_stream*) [with _val = Value_type<Letter_prot>; _locr = unsigned int; _locl = unsigned int]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/master_thread.h:972:34:   required from 'void run_ref_chunk_long(Database_file<_val>&, boost::timer::cpu_timer&, boost::timer::cpu_timer&, unsigned int, std::pair<long unsigned int, long unsigned int>, unsigned int, DAA_output&, std::vector<Temp_file>&, unsigned int) [with _val = Value_type<Letter_prot>; _locr = unsigned int; _locq = long unsigned int; _locl = unsigned int]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/master_thread.h:1116:51:   required from 'void run_query_chunk(Database_file<_val>&, boost::timer::cpu_timer&, boost::timer::cpu_timer&, unsigned int, std::pair<long unsigned int, long unsigned int>, DAA_output&) [with _val = Value_type<Letter_prot>; _locr = unsigned int; _locq = long unsigned int; _locl = unsigned int]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/master_thread.h:1210:47:   required from 'void master_thread(Database_file<_val>&, boost::timer::cpu_timer&, boost::timer::cpu_timer&) [with _val = Value_type<Letter_prot>; _locr = unsigned int]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/master_thread.h:1251:33:   required from 'void master_thread() [with _val = Value_type<Letter_prot>]'
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/main.cpp:215:36:   required from here
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_sequence.h:170:15: warning: 'void* memset(void*, int, size_t)' writing to an object of non-trivial type 'sv' {aka 'struct score_vector2<signed char>'}; use assignment instead [-Wclass-memaccess]
  170 |         memset(Mh, GAP, max_slen * 2 * sizeof(sv));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/../dp/score_vector2.h:75:8: note: 'sv' {aka 'struct score_vector2<signed char>'} declared here
   75 | struct score_vector2<int8_t>
      |        ^~~~~~~~~~~~~~~~~~~~~
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/align_sequence.h:178:15: warning: 'void* memset(void*, int, size_t)' writing to an object of non-trivial type 'sv' {aka 'struct score_vector2<signed char>'}; use assignment instead [-Wclass-memaccess]
  178 |         memset(traceback, BASE, max_slen * width * sizeof(sv));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/anaconda3/envs/kallisto/conda-bld/ac-diamond_1696755046645/work/src/run/../align/../dp/score_vector2.h:75:8: note: 'sv' {aka 'struct score_vector2<signed char>'} declared here
   75 | struct score_vector2<int8_t>
      |        ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ac-diamond.dir/build.make:76: CMakeFiles/ac-diamond.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/ac-diamond.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Extracting download

@martin-g
Copy link
Contributor

We will need a need release/tag of AC-DIAMOND to be able to compile it on ARM64.
Currently the recipe uses tag v1.0 (https://github.com/bioconda/bioconda-recipes/blob/d0879b8111b6ccdb343fb027bddca6a064febe67/recipes/ac-diamond/meta.yaml#L6) which does not include my improvements

@martin-g
Copy link
Contributor

Maihj/AC-DIAMOND#11

@martin-g
Copy link
Contributor

diff --git i/recipes/ac-diamond/build.sh w/recipes/ac-diamond/build.sh
index edafd08272..e4702e67cc 100644
--- i/recipes/ac-diamond/build.sh
+++ w/recipes/ac-diamond/build.sh
@@ -1,9 +1,14 @@
 mkdir build
 cd build
+
+ARCH=$(uname -m)
+if [ ${ARCH} == "x86_64" ]; then
+ARCH_CFLAGS="-msse4.1"
+fi
+
 cmake \
     -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-    -DCMAKE_CXX_FLAGS="${CXXFLAGS} -msse4.1" \
-    -DCMAKE_CXX_STANDARD=98 \
+    -DCMAKE_CXX_FLAGS="${CXXFLAGS} ${ARCH_CFLAGS}" \
     ..
 make
 make install
diff --git i/recipes/ac-diamond/meta.yaml w/recipes/ac-diamond/meta.yaml
index c2a63a2ca3..4cedbea4a9 100644
--- i/recipes/ac-diamond/meta.yaml
+++ w/recipes/ac-diamond/meta.yaml
@@ -1,13 +1,13 @@
 package:
   name: ac-diamond
-  version: "1.0"
+  version: "pr8"
 
 source:
-  url: https://github.com/Maihj/AC-DIAMOND/archive/v1.0.tar.gz
-  sha256: f3ee403390c3de0a2f21f025a45b35c6131f4f39510c834fbe57ade28162c87b
+  url: https://github.com/Maihj/AC-DIAMOND/archive/pr8.tar.gz
+  sha256: 66242fd45f00c71369a441148ce4648d264da7bd6acbd3e09c352c4d93fa9db8
 
 build:
-  number: 6
+  number: 0
   skip: True # [osx]
 
 requirements:

@yangxingyu588
Copy link
Author

Cool, l'm going to try it. l have a question to ask. Some Source code is not compiled on aarch64, and the local modification is not uploaded to the community because it may break the loop x86. Then l changed the source: url in meat.yaml to the local path. like:

source:
  url: file:///root/source/beagle-lib-{{ version }}.tar.gz
  sha256: 2ec5ecd1b6d70855571ed64d708440f5ef484c7ece789573d3ea1487ca8730b7

Use bioconda-utils to build the package, After the package is successfully built, upload the package to [Kunpeng_conda](Kunpeng_conda: https://mirrors.huaweicloud.com/kunpeng/archive), ls there any problem? Will it affect subsequent use?

@martin-g
Copy link
Contributor

One problem that I can see is with reproducibility. If you lose your local modifications it might be hard to re-build the package again if needed.
I believe the beagle-lib PR will be merged soon! I think the project maintainer wants to test it better against regressions.

@yangxingyu588
Copy link
Author

Thank you very much, ac-diamond has built successfully.

One problem that I can see is with reproducibility. If you lose your local modifications it might be hard to re-build the package again if needed.

yes, you're right, but there are many aarch64 versions that I have simply adapted to that have not been uploaded to the community.

I believe the beagle-lib PR will be merged soon! I think the project maintainer wants to test it better against regressions.

Yes, this is certain. Your adaptation is very cool, it is just an example to illustrate that I used a local file in the url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants