• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Support v
« Previous 1 ... 76 77 78 79 80 ... 1179 Next »

Compile Dolphin on a x86 machine for a x64 machine
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Compile Dolphin on a x86 machine for a x64 machine
10-12-2020, 06:46 PM
#1
xenoxis Offline
Junior Member
**
Posts: 4
Threads: 1
Joined: Oct 2020
Hello, i'm trying to compile Dolphin on my Linux (Ubuntu) i386 server for a gaming PC with Xubuntu on x64 system.

But i can't compile with the JIT64, cause i'm trying to build on a x86 system (it say that my pointers are 4bytes lengths etc etc...). I can only make a build without JIT (thing that i don't want obviously).

I wonder how can i make a "cross-compilation" for a x64 system ?
I know that gcc can take the
Code:
-m64
command line option, but how to pass it to the cmake script and go through all checks to detect an i386 platform ?


Hope that you'll help me,
Thanks
Find
Reply
10-13-2020, 03:59 AM
#2
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,508
Threads: 1
Joined: Feb 2012
I don't know if this is the case for Dolphin, but usually when cross-compiling with CMake you'd specify a toolchain file that pointed to the correct tools and their arguments.
OS: Windows 10 64 bit Professional
CPU: AMD Ryzen 5900X
RAM: 16GB
GPU: Radeon Vega 56
Find
Reply
10-15-2020, 02:32 AM
#3
KHg8m3r Offline
Doesn't sleep, just Dolphin and Robots
*******
Posts: 5,852
Threads: 4
Joined: Sep 2013
Why can't you just compile on the Xubuntu system? If you use the command "make -j$(nproc)" it'll use all your threads for faster compilation
Find
Reply
10-15-2020, 06:58 AM
#4
xenoxis Offline
Junior Member
**
Posts: 4
Threads: 1
Joined: Oct 2020
(10-15-2020, 02:32 AM)KHg8m3r Wrote: Why can't you just compile on the Xubuntu system? If you use the command "make -j$(nproc)" it'll use all your threads for faster compilation

My Xubuntu system is dedicated to games only, i don't want to install all librairies and softs required to compile.
On the other hand, my server has this purpose, it have a very large amounts of libs and softs for a large panels of compilations.
Moreover, with my server, i can change compilation options to optimise a specific soft for ones pc that i have, and share them with samba server.
Find
Reply
10-19-2020, 01:28 PM
#5
KHg8m3r Offline
Doesn't sleep, just Dolphin and Robots
*******
Posts: 5,852
Threads: 4
Joined: Sep 2013
I thought of a couple things you could try:

Option 1:
Forcing it on the server? I'm probably missing something but from what I can Google, this should be what you need:
-Install the gcc-multilib if not already installed: sudo apt install gcc-multilib
-Follow the Dolphin build steps: https://wiki.dolphin-emu.org/index.php?title=Building_Dolphin_on_Linux and/or the build steps for portable Dolphin https://github.com/dolphin-emu/dolphin#linux-portable-build-steps
--When you get to the cmake step add the flag: -DCMAKE_C_FLAGS -m64 (or maybe -DCMAKE_CXX_FLAGS -m64)
--I don't know what other flags you might need

Option 2:
Reinstall the server as x64. It's way easier to compile stuff for x86_32 on x86_64 than the other way around. Unless your server is old and only has x86_32 hardware.....

Option 3:
Run a VM or docker/container on the server that is x64 (if you have VT stuff turned on in your BIOS and you're running on x86_64 hardware, this should be doable in QEMU or VMware Player). Or run a VM/docker/container on the gaming computer and delete it after.

Option 4:
Just install the required libraries on your Xubuntu machine. This won't affect your ability to play games. Dolphin's requirements don't take up a lot of space.

Option 5:
Use the Snap craft version: https://snapcraft.io/dolphin-emulator. I have no idea how well this would work, how often it's updated, what other libraries you'd need to run Snaps, how well it's supported, or if you'll encounter specific problems with using the Snap vs your own compiled version. You'll also probably have problems getting support for it on these forums since it's "maintained" by someone else and is an unofficial release.
Find
Reply
10-22-2020, 01:48 AM
#6
xenoxis Offline
Junior Member
**
Posts: 4
Threads: 1
Joined: Oct 2020
(10-19-2020, 01:28 PM)KHg8m3r Wrote: I thought of a couple things you could try:

Option 1:
Forcing it on the server? I'm probably missing something but from what I can Google, this should be what you need:
-Install the gcc-multilib if not already installed: sudo apt install gcc-multilib
-Follow the Dolphin build steps: https://wiki.dolphin-emu.org/index.php?title=Building_Dolphin_on_Linux and/or the build steps for portable Dolphin https://github.com/dolphin-emu/dolphin#linux-portable-build-steps
--When you get to the cmake step add the flag: -DCMAKE_C_FLAGS -m64 (or maybe -DCMAKE_CXX_FLAGS -m64)
--I don't know what other flags you might need

Option 2:
Reinstall the server as x64. It's way easier to compile stuff for x86_32 on x86_64 than the other way around. Unless your server is old and only has x86_32 hardware.....

Option 3:
Run a VM or docker/container on the server that is x64 (if you have VT stuff turned on in your BIOS and you're running on x86_64 hardware, this should be doable in QEMU or VMware Player). Or run a VM/docker/container on the gaming computer and delete it after.

Option 4:
Just install the required libraries on your Xubuntu machine. This won't affect your ability to play games. Dolphin's requirements don't take up a lot of space.

Option 5:
Use the Snap craft version: https://snapcraft.io/dolphin-emulator. I have no idea how well this would work, how often it's updated, what other libraries you'd need to run Snaps, how well it's supported, or if you'll encounter specific problems with using the Snap vs your own compiled version. You'll also probably have problems getting support for it on these forums since it's "maintained" by someone else and is an unofficial release.

Option 1 :
i have already gcc-multilib installed.

Code:
cmake .. -DLINUX_LOCAL_DEV=true -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_FLAGS=-m64

-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1")
-- Detected architecture: i686
CMake Error at CMakeLists.txt:214 (message):
  You're building on an unsupported platform: 'i686' with 8-byte pointers.
  Enable generic build if you really want a JIT-less binary.


-- Configuring incomplete, errors occurred!
See also "/home/xenoxis/Git/dolphin/Build/CMakeFiles/CMakeOutput.log".
See also "/home/xenoxis/Git/dolphin/Build/CMakeFiles/CMakeError.log".
Dolphin doesn't care if I try to cross-compile to an x64 version. I check only the current pointer size, not the platform destination.

Option 2 :
My server has only i386 arch support, and even considering all work to be done to backup and reinstall, i can't be considered.

Option 3 :
The server can't proper run a VM as he don't have any virtualisations accelerations.

Options 4 and 5 can be envisaged but they will be the very last solution.
Find
Reply
10-22-2020, 02:30 AM
#7
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,508
Threads: 1
Joined: Feb 2012
There are probably more variables you need than just the `-m64` to get CMake to figure out it's supposed to be targeting 64-bit. Also, I'm reasonably sure it won't happen early enough in CMake's configure process if you set the variables on the command line rather than with a toolchain file. If you look at their toolchains documentation, the https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux bit gives an example toolchain file that looks like this:


Code:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_SYSROOT /home/devel/rasp-pi-rootfs)
set(CMAKE_STAGING_PREFIX /home/devel/stage)

set(tools /home/devel/gcc-4.7-linaro-rpi-gnueabihf)
set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)


If I were you, I'd create a CMake toolchain file that looks something like this:


Code:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i686)

# set a different sysroot as in the example if your 64-bit libs aren't in the same place as your 32-bit ones

set(CMAKE_C_FLAGS -m64)
set(CMAKE_CXX_FLAGS -m64)


and then add -DCMAKE_TOOLCHAIN_FILE=/path/to/the/toolchain/file to the command you call CMake with.


Actually, looking at the specific error message, this might be a bug in Dolphin's CMake. It's expecting the architecture to be called x86_64, amd64, or AMD64, whereas CMake/GCC have decided to call it i686. Maybe try the same command as last time, but with -DCMAKE_SYSTEM_PROCESSOR=amd64. If that doesn't work, probably try the toolchain stuff in the crossed-out part of this post, but probably keep the amd64 bit from the non-crossed-out part.
OS: Windows 10 64 bit Professional
CPU: AMD Ryzen 5900X
RAM: 16GB
GPU: Radeon Vega 56
Find
Reply
10-26-2020, 03:24 AM
#8
xenoxis Offline
Junior Member
**
Posts: 4
Threads: 1
Joined: Oct 2020
(10-22-2020, 02:30 AM)AnyOldName3 Wrote:
Code:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i686)

# set a different sysroot as in the example if your 64-bit libs aren't in the same place as your 32-bit ones

set(CMAKE_C_FLAGS -m64)
set(CMAKE_CXX_FLAGS -m64



Actually, looking at the specific error message, this might be a bug in Dolphin's CMake. It's expecting the architecture to be called x86_64, amd64, or AMD64, whereas CMake/GCC have decided to call it i686. Maybe try the same command as last time, but with -DCMAKE_SYSTEM_PROCESSOR=amd64. If that doesn't work, probably try the toolchain stuff in the crossed-out part of this post, but probably keep the amd64 bit from the non-crossed-out part.

I've tried with the command :

Code:
~/Git/dolphin/Build$ cmake .. -DCMAKE_TOOLCHAIN_FILE=./CrossCompile.txt

The file called "CrossCompile.txt" contain :

Code:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR amd64)

set(CMAKE_C_FLAGS -m64)
set(CMAKE_CXX_FLAGS -m64)

It output the same error as before.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode