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

Changes for MinGW-w64 environment #54

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Changes for MinGW-w64 environment #54

wants to merge 6 commits into from

Conversation

astanabe
Copy link

I changed several codes for MinGW-w64 environment.
However, the following problems still exist.

  • Cannot make executable because of lack of hsearch,hcreate,hdestroy functions
    Several hash functions used in libpll are not available on MinGW-w64 environment. These functions need to be replaced or emulated.

  • _aligned_free should be used for freeing memory instead of free on MinGW-w64 environment
    Because posix_memalign is not available on MinGW-w64, posix_memalign is emulated by _aligned_malloc in my code. The memory allocated by _aligned_malloc must be freed by _aligned_free. However, I cannot find aligned object in codes of raxml-ng.

@astanabe
Copy link
Author

astanabe commented Nov 27, 2018

To perform compilation, type the following on the terminal of MSYS2+MinGW-w64.
mkdir build; cd build; cmake -DCMAKE_TOOLCHAIN_FILE=../mingw-w64.cmake -G "MSYS Makefiles" ..; make

@astanabe
Copy link
Author

The "hsearch,hcreate,hdestroy" functions are used in pll_msa.c in pll-modules. To fix hsearch,hcreate,hdestroy problem on MinGW-w64 environment, pll_msa.c need to be modified.

@astanabe
Copy link
Author

astanabe commented Nov 27, 2018

Using modified version of pll-modules (https://github.com/astanabe/pll-modules/tree/dev), I got an executable binary of raxml-ng.
However, this binary do not run correctly.
Here is a backtrace of gdb.

[00:00:00] Generating 1 parsimony starting tree(s) with 11 taxa

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000000489fc7 in create_shuffled (n=11, seed=28170)
    at C:/msys64/home/shimotsuki/raxml-ng-master/libs/pll-modules/libs/libpll/src/stepwise.c:88
88            PLL_SWAP(x[i],x[j]);
(gdb) backtrace
#0  0x0000000000489fc7 in create_shuffled (n=11, seed=28170)
    at C:/msys64/home/shimotsuki/raxml-ng-master/libs/pll-modules/libs/libpll/src/stepwise.c:88
#1  0x000000000048aa17 in pll_fastparsimony_stepwise (list=0x4d4de80,
    labels=0x4d4bbc0, cost=0x24aefbc, count=1, seed=28170)
    at C:/msys64/home/shimotsuki/raxml-ng-master/libs/pll-modules/libs/libpll/src/stepwise.c:440
#2  0x0000000000446d6a in pllmod_utree_create_parsimony_multipart (
    taxon_count=11, taxon_names=0x4d4bbc0, partition_count=1,
    partitions=0x4d4bc50, random_seed=28170, score=0x24aefbc)
    at C:/msys64/home/shimotsuki/raxml-ng-master/libs/pll-modules/src/tree/pll_tree.c:918
#3  0x000000000041d750 in Tree::buildParsimony (parted_msa=...,
    random_seed=28170, attributes=18, score=0x24aefbc)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/Tree.cpp:181
#4  0x0000000000437d29 in generate_tree (instance=...,
    type=StartingTree::parsimony)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:771
#5  0x0000000000439966 in build_start_trees (instance=..., skip_trees=0)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:1033
#6  0x000000000043eb21 in master_main (instance=..., cm=...)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:1897
#7  0x000000000043f607 in internal_main (argc=9, argv=0x4d43f50, comm=0x0)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:2096
#8  0x000000000043fd32 in main (argc=9, argv=0x4d43f50)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:2190

Another backtrace.

[00:00:03] ML tree search #1, logLikelihood: -5446.356485

warning: Critical error detected c0000374

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffc353383eb in ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) backtrace
#0  0x00007ffc353383eb in ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffc3533f96a in ntdll!RtlpNtMakeTemporaryKey ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffc352dfbf2 in ntdll!RtlSetProxiedProcessId ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x00007ffc352fa20c in ntdll!memset () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x00007ffc3273984c in msvcrt!free () from C:\WINDOWS\System32\msvcrt.dll
#5  0x0000000000484fb7 in dealloc_partition_data (partition=0x6529fd0)
    at C:/msys64/home/shimotsuki/raxml-ng-master/libs/pll-modules/libs/libpll/src/pll.c:126
#6  0x0000000000486e5a in pll_partition_destroy (partition=0x6529fd0)
    at C:/msys64/home/shimotsuki/raxml-ng-master/libs/pll-modules/libs/libpll/src/pll.c:869
#7  0x000000000041fe19 in TreeInfo::~TreeInfo (this=0x45be290,
    __in_chrg=<optimized out>)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/TreeInfo.cpp:111
#8  0x000000000041fe85 in TreeInfo::~TreeInfo (this=0x45be290,
    __in_chrg=<optimized out>)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/TreeInfo.cpp:117
#9  0x000000000051788e in std::default_delete<TreeInfo>::operator() (
    this=0x24af320, __ptr=0x45be290)
    at C:/msys64/mingw64/include/c++/8.2.0/bits/unique_ptr.h:81
#10 0x000000000056de83 in std::unique_ptr<TreeInfo, std::default_delete<TreeInfo> >::~unique_ptr (this=0x24af320, __in_chrg=<optimized out>)
    at C:/msys64/mingw64/include/c++/8.2.0/bits/unique_ptr.h:274
#11 0x000000000043e753 in thread_main (instance=..., cm=...)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:1665
#12 0x000000000043ec9b in master_main (instance=..., cm=...)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:1928
#13 0x000000000043f607 in internal_main (argc=9, argv=0x45b3f50, comm=0x0)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:2096
#14 0x000000000043fd32 in main (argc=9, argv=0x45b3f50)
    at C:/msys64/home/shimotsuki/raxml-ng-master/src/main.cpp:2190

@amkozlov
Copy link
Owner

amkozlov commented Nov 28, 2018

@astanabe many thanks for working on this! I will integrate your changes and try to produce a working raxml-ng version for windows as soon as I have a bit more time.

@tomas-fer
Copy link

Is there any success with Windows binaries for raxml-ng? Thank you,
Tomas

@astanabe
Copy link
Author

astanabe commented Feb 6, 2020

I compiled RAxML-NG several times, but initial parsimonious tree construction did not work and execution was terminated.
ML optimization of fixed tree topology and single ML tree search starting from a given tree topology or a random tree topology works well (but multiple ML tree searches starting from multiple random tree topologies did not work).

@tomas-fer
Copy link

tomas-fer commented Feb 6, 2020 via email

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

Successfully merging this pull request may close these issues.

3 participants