Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linux - Compile Guide and Support
#21
2633 should be compilable.
Reply

Sponsored links

#22
Is CMake working now?
when I cmake CMakeLists.txt, I get
Code:
[..]
-- Configuring done
CMake Error in pcsx2/CMakeLists.txt:
  Cannot find source file "Vif_Commands.cpp".  Tried extensions .c .C .c++
  .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
in r2682
Reply
#23
CMake support was added, but is still a bit iffy. It breaks occasionally, and I've had issues with binaries generated from it before. It's mainly in so it can be worked on, and doesn't get too out of date. The preferred way to compile pcsx2 in Linux at the moment is still with Codeblocks.
Reply
#24
Guide to building the latest svn CMake version in Ubuntu.

Disclaimer: The resulting binary runs the GUI perfectly fine but it seemed to hang when running games. Regardless, I wanted to post this since others may find this useful in the future when CMake is more stable.

First of all, if you are on Ubuntu 64-bit, follow the tutorial at:
http://jblevins.org/computing/linux/ubuntu-chroot
to set up a chroot environment. It should take up approximately 800 MB of hard drive space after all the packages are installed.

The rest of these instructions assume you have already run "dchroot" and have a terminal running inside the 32-bit chroot.

sudo apt-get install subversion cmake
svn checkout http://pcsx2.googlecode.com/svn/trunk pcsx2-beta
cd pcsx2-beta


If your version of CMake is missing FindGTK2.cmake and FindAlsa.cmake, you can find them here (click the "raw" link to download):
http://cmake.org/gitweb?p=cmake.git;a=tree;f=Modules
mkdir cmake/Modules
mv FindGTK2.cmake cmake/Modules/FindGTK2.cmake
mv FindALSA.cmake cmake/Modules/FindALSA.cmake


If you are using the chroot, you will need:
sudo apt-get install libgl1-mesa-dev
Do not install this outside chroot since it may break your graphics drivers.

sudo apt-get install libbz2-dev nvidia-cg-toolkit libportaudio2
For ZeroPAD:
sudo apt-get install libsdl1.2-dev
For ZeroGS:
sudo apt-get install libglew1.5-dev libxxf86vm-dev

Ubuntu's version of portaudio is missing libportaudiocpp. There is a package called "libportaudiocpp" but it is missing all the include files at /usr/include/portaudiocpp/. To fix this, use Debian's version, which is compatible but has the required files:
http://packages.debian.org/testing/portaudio19-dev
On that page, download the .deb file for i386.
Run sudo dpkg -i portaudio19*.deb
Then, if it complains do sudo apt-get -f install which should install any other dependencies.
When finished, you should have a directory at /usr/include/portaudiocpp/

Finally, the CMakeLists.txt are a bit buggy. You need to apply these two changes:
Code:
Index: cmake/Pcsx2Utils.cmake
===================================================================
--- cmake/Pcsx2Utils.cmake    (revision 2682)
+++ cmake/Pcsx2Utils.cmake    (working copy)
@@ -15,7 +15,7 @@
                      DEPENDS bin2cpp)

    # create a custom command for every resource file
-    foreach(entry IN LISTS ARGV)
+    foreach(entry ${ARGV})
        # create custom command and assign to target Resources
        add_custom_command(TARGET Resources POST_BUILD
                           COMMAND bin2cpp ${entry}
Index: pcsx2/CMakeLists.txt
===================================================================
--- pcsx2/CMakeLists.txt    (revision 2682)
+++ pcsx2/CMakeLists.txt    (working copy)
@@ -167,7 +167,6 @@
    SPR.cpp
    Stats.cpp
    System.cpp
-    Vif_Commands.cpp
    Vif0_Dma.cpp
    Vif1_Dma.cpp
    Vif1_MFIFO.cpp

Now, run
cmake -DCMAKE_MODULE_PATH=cmake/Modules/ .
make -j3


To build plugins, you need autoconf and automake installed:
sudo apt-get install autoconf automake
cd plugins/zeropad
aclocal
autoconf
automake -a
./configure --enable-debug --prefix=$PWD/../../bin/plugins
make -j3
make install
cd ../..


cd plugins/zerogs/opengl
aclocal
autoconf
automake -a
./configure --enable-sse2 --prefix=$PWD/../../../bin/plugins
make
make install
cd ../../..


Running

It is possible to run the binary from your 64-bit system, provided you tell it where to find libraries. The easiest way is doing:
export LD_LIBRARY_PATH=/var/chroot/xxx_i386/usr/lib

If you want it to work without LD_LIBRARY_PATH at your own risk, you can also copy the libraries from /var/chroot/xxx_i386/usr/lib/* into /usr/lib32 but use "cp -i" for confirmation and MAKE SURE you do not overwrite your 64-bit libraries with 32-bit because that will break your system.

For it to work properly, I had to mkdir ~/pcsx2 before running pcsx2 and configuring.
Reply
#25
ok, i'd like to get some info how to make the video plugin spit out some more info when it fails to initialise.

i'm trying to launch ps2 bios on pcsx2 with gallium 3d drivers, but the error messages give me no clues on the problem. can i somehow get the video plugin to give me more info, except that it failed to initialize?
Reply
#26
I'm getting the following error when I try to compile it on Ubuntu 10.04 beta2 64bit (under a 32bit chroot enviroment):

Quote:[email protected]:~/pcsx2-beta$ cmake -DCMAKE_MODULE_PATH=cmake/Modules/ .-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found GTK2_GTK: /usr/lib/libgtk-x11-2.0.so
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
Could NOT find wxWidgets (missing: wxWidgets_FOUND)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindwxWidgets.cmake:807 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/SearchForStuff.cmake:38 (find_package)
CMakeLists.txt:10 (include)

Any help?

Thanks in advance!
Reply
#27
Quote:Could NOT find wxWidgets (missing: wxWidgets_FOUND)
This is you error. Couldn't you guess how to fix it?
Reply
#28
Hi,

In process to build pcsx2 in debian/amd64 without chroot using directly ia32-libs on debian. I m using cmake stuff. I have some suggestions/questions.

What is the version of gcc/g++ supported ? With the version 4.4, I had some errors with some functions that gcc can not inline.
* One example: pcsx2.snapshot-2892/pcsx2/x86/newVif_Dynarec.cpp:212: sorry, unimplemented: inlining failed in call to ‘void dVifUnpack(int, u8*, u32, bool)’: recursive inlining

For the compilation process, in my situation the linker need a "-m32" flags. (no impact on 32bit machines). I think it will be a good idea to had it. For information the current method for stripping does not work as expected.
* Current method: set(LinkerFlags -s) and add_definitions(... ${LinkerFlags} ...)
* For exe you can use: set(CMAKE_EXE_LINKER_FLAGS "-m32") or set(CMAKE_EXE_LINKER_FLAGS "-m32 -s")
* For library it is a bit more tricky: target_link_libraries(${zerogsName} -m32) or target_link_libraries(${zerogsName} -m32 -s)
As a side note, it will be good to have a variable to enable/disable the -s flag, like the optimization flag. Some distributions (like debian) want to control the strip during the packaging process.

Thanks,
Gregory
Reply
#29
Two things:

First, the cmake build system is experimental. It's actually known to have issues even if you get it to compile. Getting it working is on the to-do list, but isn't really a high priority. Right now, it hasn't been updated to reflect a few file additions/deletions from within the last week yet (though if you manage to get it working, I'll certainly be willing to commit the changes necessary). Building is normally done through Code::Blocks.

Second, building under a 64 bit operating system isn't supported at the moment. Mainly because doing so is rather tricky, and I didn't manage to get it working again after we switched build systems. What is recommended right now is to build it inside a chroot.

Basically, pcsx2 depends on x86emitter, Utilities, and a local copy of zlib, plus having 8+ plugins, all of which have to have m32 in the flags. To further complicate things, the project has inline assembly, and a few .S files. I actually did put m32 in the flags for everything, but never had much luck getting it working. (Whereas it works inside a chroot without issues.)

Oh, and the version of gcc currently used for testing is 4.4.2. The inlining errors are because when you build for 64 bits, it's pickier about inlining. Its basically a sign that it's not building for the right arch. If it got past that it would eventually have started complaining about the assembly in the project. (If you change "_f void dVifUnpack" to "void dVifUnpack", it'll get rid of the inlining, btw...)
Reply
#30
Hi,

Yes I'm aware that both are not supported for the moment. Anyway I did manage to build the stuff. In 3rdparty software, I only compile soundtouch for the others I kept my distribution libraries. Note I did not play a game for the moment, I just lauch pcsx2.

For inline, it also happen in a 32bit virtual machine. It is maybe a gcc flag problem, I do not know. I just remove them for the moment. I use a similar version of gcc 4.4.3 ~ 4.4.4

I join a patches.tar.gz which contains some of my updates. Please feel free to cherry pick what it is usefull for you and throw the remainder^^

Enjoy.

----------------------patch description. Based on SVN revision 2937
+ 02_cmake_force_32bit_link.patch
* add missing -m32 in soundtouch cmake

+ 03_cmake_old_file.patch
* cmakelist: add new file & remove old file

+ 05_fix_return_void_function.patch
* Return without value for a void function (C code)

+ 08_add_zeropad_cmake_and_fix.patch
* Create cmake list file for zeropad plugin
* Set a special variable for SDL detection
* Define a missing constant (C code)

+ 10_find_xxf86vm.patch
* Add a detection of libxxf86

+ 13_add_cdvdiso_cmake_and_fix.patch
* Create cmake list file for cdvdiso

+ 14_align_struct_def_and_header.patch
* Add some #ifdef windows pragma to be conform to the header modification (C code)
Reply




Users browsing this thread: 1 Guest(s)