davidrmiller / biosim4

Biological evolution simulator
Other
3.1k stars 435 forks source link

New to everything, how does someone run this? #89

Open Bowteye opened 1 year ago

Bowteye commented 1 year ago

This might not be a great question or be bad for some other reason, but I really have no idea what I'm doing. How do I get this program to run, and can it even run on windows? Sorry if someone has already asked this but I couldn't find it anywhere.

Thanks in advance!

Bowteye commented 1 year ago

Nevermind, just read through some closed issues and it looks like it's not possible to run without Linux.

davidrmiller commented 1 year ago

Hi @Bowteye , welcome to the discussion. Clever community members have reported getting it to run on Windows. Probably the easiest way is to run the docker image in a Windows powershell terminal. Alternatively you may be able to compile the source code in Windows Subsystem for Linux (WSL). See Issues #1, #13, #14, and #60 for more information. Also, Issue #77 describes an interesting port to Windows by @oxi-dev0.

duskallegro commented 1 year ago

Nevermind, just read through some closed issues and it looks like it's not possible to run without Linux.

Just get VirtualBox and launch Linux virtual machine

jpcofr commented 1 year ago

You can get it to run in Windows. This morning I got it to run in macOS by tweaking the CMakeLists as well as downloading/ installing other libraries and setting up paths. I could not get it to use CImg because CImg latest version is not compatible with the API used by Dr @davidrmiller, so I do not have the fancy graphs from the Youtube video but still I got it to execute locally.

Goahnary commented 1 year ago

@jpcofr could you expand on how to get those libraries installed on macos? Just kick us in the right direction?

jpcofr commented 1 year ago

@Goahnary I'm afraid I forgot the libraries I had to install. Which libraries are breaking your build? Anyway, this is the CMakeLists.txt that worked for me:

cmake_minimum_required(VERSION 3.0.0)
project(BioSim4 VERSION 0.2.0)

include(CTest)

link_directories("/opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current")
set(CMAKE_C_COMPILER "/opt/homebrew/opt/llvm/bin/clang")
set(CMAKE_CXX_COMPILER "/opt/homebrew/opt/llvm/bin/clang++")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CPPFLAGS} ${LDFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPPFLAGS} ${LDFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LDFLAGS}")

enable_testing()

add_subdirectory(src)

install(FILES ./biosim4.ini DESTINATION ./)
install(DIRECTORY ./tools/ DESTINATION tools)
install (DIRECTORY DESTINATION "logs" DIRECTORY_PERMISSIONS
    OWNER_WRITE OWNER_READ OWNER_EXECUTE
    GROUP_READ GROUP_READ GROUP_EXECUTE
    GROUP_READ WORLD_READ WORLD_EXECUTE)
install (DIRECTORY DESTINATION "images" DIRECTORY_PERMISSIONS
    OWNER_WRITE OWNER_READ OWNER_EXECUTE
    GROUP_READ GROUP_READ GROUP_EXECUTE
    GROUP_READ WORLD_READ WORLD_EXECUTE)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)