Git Product home page Git Product logo

Comments (12)

Garux avatar Garux commented on June 23, 2024

Please give more of error log, can't prompt w/o exact context.
Clang is always extra picky and requires code tuning.

from netradiant-custom.

fmazur avatar fmazur commented on June 23, 2024

Please give more of error log, can't prompt w/o exact context. Clang is always extra picky and requires code tuning.

Here is full make log after make clean: https://pastebin.com/z1SHRUQJ

from netradiant-custom.

Garux avatar Garux commented on June 23, 2024

I pushed branch with fix of this one https://github.com/Garux/netradiant-custom/tree/Qt-macOS2

from netradiant-custom.

fmazur avatar fmazur commented on June 23, 2024

I pushed branch with fix of this one https://github.com/Garux/netradiant-custom/tree/Qt-macOS2

Thank you! It resolved that issue. I'm stuck on next part. I've verified that X11 is working and that I can run X11 applications.
Paths that linker is looking for are there.

[fmazur@freya ~]$ ls /usr/X11
bin	etc	include	lib	libexec	share	var
[fmazur@freya ~]$ ls /usr/X11R6
bin	etc	include	lib	libexec	share	var

After cpp/c compile finished it tired to do install/libassimp_.dylib and install/q3map2.arm64:
https://pastebin.com/cPziej6J

I've zlib and assimp installed and exported before compile

export LDFLAGS="-L/opt/homebrew/opt/zlib/lib"
export CPPFLAGS="-I/opt/homebrew/opt/zlib/include"

I'm unable to debug this myself.

from netradiant-custom.

Garux avatar Garux commented on June 23, 2024

This is commit, which enabled mac build the other day f7d120f. I believe unzip.cpp part is your stuff.
These funcs likely were force-present in environment b4 and thus disabled.

from netradiant-custom.

fmazur avatar fmazur commented on June 23, 2024

This is commit, which enabled mac build the other day f7d120f. I believe unzip.cpp part is your stuff. These funcs likely were force-present in environment b4 and thus disabled.

unzip is provided by system on M1 machines.
I've reverted the commit to restore MACLIBDIR. I've added /opt/local/lib to the path. (that's the path that contains X11 etc, not /usr/local/lib from what I've checked)

Here is a list of libs that are in MACLIBDIR, active ports and full compile log
https://pastebin.com/5cJmJngU
https://pastebin.com/hTNGQKLG

I'm not familiar with clang stuff so best I can do i try stuff and provide logs.

from netradiant-custom.

Garux avatar Garux commented on June 23, 2024

Have you surely removed ifdefs/recompiled? Because lets see the 1st one, it's not there, when it's disabled by ifdefs
image
And it was exactly the problem the other time.

from netradiant-custom.

fmazur avatar fmazur commented on June 23, 2024

Right. I was confused for a bit, thought I just had to revert that commit and not cherry-pick.
After cherry-picking that commit that removed ifdefs and updating MACLIBDIR it continued to build but it hangs on something.

[fmazur@freya ~/Games/netradiant-custom]$ git diff
diff --git a/Makefile b/Makefile
index 8cc8a972..d39dc3ee 100644
--- a/Makefile
+++ b/Makefile
@@ -232,7 +232,7 @@ ifeq ($(OS),Darwin)
        CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
        CFLAGS_COMMON += -fPIC
        CXXFLAGS_COMMON += -fno-exceptions -fno-rtti
-       MACLIBDIR ?= /usr/local/lib
+       MACLIBDIR ?= /opt/local/lib
        CPPFLAGS_COMMON += -I$(MACLIBDIR)/../include -I/usr/X11R6/include
        LDFLAGS_COMMON += -L$(MACLIBDIR) -L/usr/X11R6/lib
        LDFLAGS_DLL += -dynamiclib -ldl
diff --git a/tools/mbspc/qcommon/q_platform.h b/tools/mbspc/qcommon/q_platform.h
index d3b3b6b0..a11b0198 100644
--- a/tools/mbspc/qcommon/q_platform.h
+++ b/tools/mbspc/qcommon/q_platform.h
@@ -156,6 +156,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #define idx64 1
 #define ARCH_STRING "x86_64"
 #define Q3_LITTLE_ENDIAN
+#elif defined __aarch64__
+#define ARCH_STRING "arm64"
+#define Q3_LITTLE_ENDIAN
 #endif

 #define DLL_EXT ".dylib"

Had to define arm section for q_platform as it errored out on unsupported platform and endianness which made it not appear anymore?
End of build log with nm output for CurrentDirectory method from libassimp_.dylib and contents of install folder https://pastebin.com/zkH9t4Hb

Each time I clean build and builds are in arm64. I'll try to revert the f7d120f commit and try to build in i386 maybe?

from netradiant-custom.

Garux avatar Garux commented on June 23, 2024

Great, so now linker can't find assmodel.dylib.
-Wl,-rpath '-Wl,$ORIGIN/..' is the trick to find it in linux; in windows it works out of the box.
Idk what's the way for mac now, the other time it was linked normally, but missing in runtime; fix was:

% install_name_tool -change install/libassimp_.dylib @executable_path/libassimp_.dylib assmodel.dylib

(for assmodel.dylib particularly)

from netradiant-custom.

fmazur avatar fmazur commented on June 23, 2024

That would probably work if assmodel.dylib existed but it doesn't get compiled.

[fmazur@freya ~/Games/netradiant-custom]$ install_name_tool -change install/libassimp_.dylib @executable_path/libassimp_.dylib assmodel.dylib
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: assmodel.dylib (No such file or directory)

I presume the $$ORIGIN trick could be replaced with -Wl,-rpath,@loader_path/.. -Wl,-rpath,@executable_path/.. for M1

Not sure whether you need full log but here is end part with the changed $$ORIGIN
https://pastebin.com/wZBU7vTR

[fmazur@freya ~/Games/netradiant-custom]$ ls install/
h2data			libassimp_.dylib	q2map.arm64		qdata3.arm64
h2data.arm64		q2map			qdata3

I presume libassimp_.dylib is not complete (4,3mb)

There is assimp available in /opt/local/lib/libassimp.dylib and /opt/local/include/assimp and there is assimp in project libs. I assume this is to build against custom assimp?

from netradiant-custom.

Garux avatar Garux commented on June 23, 2024

I mixed up, was meant to say

Great, so now linker can't find libassimp_.dylib

4,3mb is okay; building own version of assimp because at the time of adding it required adjustments to have it usable and for stability.

Oh, and -Wl,-rpath '-Wl,$ORIGIN/..' is related to finding dylib in runtime.
Current problem is linker not finding assimp from -lassimp_ -Linstall prompts (or less likely broken assimp build).

May be lets contact in some discord to enfasten this, my id is 246624639655215114 there.

from netradiant-custom.

fmazur avatar fmazur commented on June 23, 2024

After honing out remaining M1 quirks I was able to make on M1. Here is more or less updated guide since I don't have access to clean env:

ARM M1 Max
Darwin freya 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64

environment:

  • OS X 14.3

  • Xcode 15.2

  • X11 provided by Xquatz 2.8.5

  • MacPorts 2.9.1-14-Sonoma, homebrew installed

  • the following packages installed:
    Macports:
    gtkglext pkgconfig glib2-devel libxml2 gtk2 pango atk gettext wget assimp Qt5Core Qt5Gui Qt5Widgets subversion xorg zlib zstd

    Branch Qt-macOS2-M1 ( after being merged #169 - Qt-macOS2 )
    Locate your lib folder either /usr/local/lib or /opt/local/lib ( mine was the /opt/local/lib ) and update Makefile MACLIBDIR path
    There were issues with linking -lassimp_ . I had luck using port installed assimp -lassimp (assimp 5.3.1)

    I'm not sure which packaged are needed after subversion since xorg may have been provided by xquartz but check whether /usr/X11R6 and /usr/X11 directories exist.

build:
run 'make -j16'

run:
./install/radiant.arm64

Edit: Crossed out packages that are most likely not needed.

from netradiant-custom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.