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

FreeBSD build? #105

Closed
Peter2121 opened this issue Mar 23, 2018 · 16 comments
Closed

FreeBSD build? #105

Peter2121 opened this issue Mar 23, 2018 · 16 comments
Assignees
Milestone

Comments

@Peter2121
Copy link

I'm trying to build wxHexEditor (cloned from GitHub) on FreeBSD 11 with codeblocks installed.

The project opens correctly, but trying to build it I get many errors about headers lost:

||=== Build: Release in wxHexEditor (compiler: GNU GCC Compiler) ===|
mhash/include/mutils/mincludes.h|34|fatal error: mutils/mhash_config.h: No such file or directory|
mhash/include/mutils/mincludes.h|34|fatal error: mutils/mhash_config.h: No such file or directory|
/usr/home/peter/Programming/wxHexEditor/src/FAL.h|34|fatal error: wx/wx.h: No such file or directory|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
/usr/home/peter/Programming/wxHexEditor/src/HexEditorApp.h|53|fatal error: wx/app.h: No such file or directory|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Following your Linux procedure in COMPILE, I need to install

wxHexEditor library for compilation

It is not clear at all, no such library is available in your GitHub account.
Both wx28-gtk2-2.8.12 and wx30-gtk2-3.0.2 are installed in my system.

@EUA
Copy link
Owner

EUA commented Mar 23, 2018

Hi,
error: wx/wx.h
means you don't setup wxGTK properly. Probably you need to install development packages instead of run libs.
"mutils/mhash_config.h" error means you don't compile mhash library first.

Indeed I don't remember how I compile it in FreeBSD.
You might be better using make command after installing wxgtk-devel.

@Peter2121
Copy link
Author

There is no *-devel packages in FreeBSD, normal library package installs all the necessary files to compile anything.
I have wx.h in /usr/local/include/wx-2.8/wx and in /usr/local/include/wx-3.0/wx, there are many other *.h files in these dirs.
I'll try with make command.

@EUA
Copy link
Owner

EUA commented Mar 24, 2018

Himm, probably your compiler path doesn't include /usr/local/include but /usr/include

@Peter2121
Copy link
Author

So, I added to my environment:

LD_LIBRARY_PATH=/usr/local/lib
LIBRARY_PATH=/usr/local/lib
CPATH=/usr/local/include

Then I modified in Makefile:
WXCONFIG ?= wx-config
to
WXCONFIG ?= wxgtk2u-2.8-config

Then I try to build it using gmake.
I got compilation errors like this:

src/FAL.cpp:65:12: error: use of undeclared identifier 'DKIOCGETBLOCKSIZE'
        ioctl(FD, DKIOCGETBLOCKSIZE, &block_size);
src/FAL.cpp:85:12: error: use of undeclared identifier 'DKIOCGETBLOCKCOUNT'
        ioctl(FD, DKIOCGETBLOCKCOUNT, &block_count);
src/FAL.cpp:866:13: error: no matching function for call to 'ptrace'
                                        word = ptrace(PTRACE_PEEKTEXT, ProcessID, addr);
src/FAL.cpp:885:50: error: arithmetic on a pointer to void
                        memcpy( buffer, internal_file_buffer.GetData()+from, size );

@EUA
Copy link
Owner

EUA commented Mar 24, 2018

Himm. They are the real issues. I have to change some locations to make it compatible for FreeBSD.
I will install FreeBSD VM and try to fix them.
Thanks.

@EUA EUA self-assigned this Mar 24, 2018
@EUA EUA added the bug label Mar 24, 2018
@EUA EUA added this to the v0.25 milestone Mar 24, 2018
@Peter2121
Copy link
Author

Thanks for supporting our platform, hope to see wxHexEditor in ports tree one day ;)

@EUA
Copy link
Owner

EUA commented Mar 26, 2018

@Peter2121 I like to support but ... I think FreeBSD has some issues with KVM/QEMU Xorg VM setups.
I just download X11 qcow image and installed xorg & gnome3. But xorg doesn't want to work...
Any help?

@Peter2121
Copy link
Author

As it was mentioned in the forum post, it is really simple to use VirtualBox. There are VB additions that you can install directly from packages on VM, and if you install Oracle VB extensions on the host - even the video acceleration should work correctly on guest VM. I can share a pre-installed VB image if you want.
As I use FreeBSD as OS, I have no experience of using KVM. I know that FreeBSD as guest works fine on VirtualBox and VMware ESXi/Workstation.
As about DE - you should use XFCE or LXDE, that's the most stable DEs on FreeBSD. You can try Lumina too.

@EUA
Copy link
Owner

EUA commented Mar 26, 2018

Installed using UEFI way. It's Working now.
Also fixed many things and able to compile right now...
But now wxHexEditor gives segmentation fault at startup.
Probably BSD support will updated this night or next.

@EUA
Copy link
Owner

EUA commented Mar 26, 2018

@Peter2121 I just compiled and got segfault. As I understand segfault not due program because it's before execution of init.
So I decide compile wxWidgets at FreeBSD. Unfortunately, with same result.
When I try to compile & run wxWidgets own samples at samples directory, they also give segmentation error and exit. I don't know what is happening here. I compiled wxWidgets lib for both GTK2 and GTK3 with same result...

@EUA
Copy link
Owner

EUA commented Mar 27, 2018

I don't know when and why this clang love appeared on BSD but the problem is GCC incompatibility.
After switching to clang, it starts working.
You can compile easily with
gmake WXCONFIG=wxgtk2-3.0-config
old make command make some error on compilation somehow, use gmake please...
Anyway, It's your turn to make beta testing. 👍

@EUA EUA added enhancement and removed bug labels Mar 27, 2018
@Peter2121
Copy link
Author

It seems that there is a problem of library:

$ gmake WXCONFIG=/usr/local/bin/wxgtk2u-3.0-config
c++ src/HexEditorGui.o src/FAL.o src/HexDialogs.o src/HexPanels.o src/HexEditorApp.o src/HexEditor.o src/HexEditorCtrl/HexEditorCtrl.o src/HexEditorCtrl/wxHexCtrl/TagDialogGui.o src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.o src/HexEditorCtrl/wxHexCtrl/Tag.o src/HexEditorCtrl/HexEditorCtrlGui.o src/HexEditorFrame.o -lgomp udis86/libudis86/.libs/libudis86.a mhash/lib/.libs/libmhash.a   `/usr/local/bin/wxgtk2u-3.0-config --libs` `/usr/local/bin/wxgtk2u-3.0-config --libs aui` `/usr/local/bin/wxgtk2u-3.0-config --libs core` -o wxHexEditor
/usr/bin/ld: cannot find -lgomp

/usr/local/lib/gcc6/libgomp.so.1.0.0 is present, symlink libgomp.so is present in the same dir
Adding /usr/local/lib/gcc6 to LIBRARY_PATH don't help a lot - there are still OPENMP related errors:

src/HexDialogs.o: In function `FindDialog::FindBinaryForward(wxMemoryBuffer, unsigned long, unsigned long, unsigned int,
wxProgressDialog*, wxString&, unsigned long&)':
src/HexDialogs.cpp:(.text+0x5eed): undefined reference to `__kmpc_fork_call'
src/HexDialogs.o: In function `.omp_outlined.':
src/HexDialogs.cpp:(.text+0x7342): undefined reference to `__kmpc_for_static_init_4'
src/HexDialogs.cpp:(.text+0x740f): undefined reference to `__kmpc_for_static_fini'
src/HexDialogs.o: In function `CompareDialog::Compare(wxFileName, wxFileName, bool, int, wxFileName)':
src/HexDialogs.cpp:(.text+0xeb38): undefined reference to `__kmpc_fork_call'
src/HexDialogs.o: In function `.omp_outlined..124':
src/HexDialogs.cpp:(.text+0x11886): undefined reference to `__kmpc_for_static_init_4'
src/HexDialogs.cpp:(.text+0x11b8a): undefined reference to `__kmpc_for_static_fini'
src/HexDialogs.o: In function `ChecksumDialog::CalculateChecksum(FAL&, int)':
src/HexDialogs.cpp:(.text+0x13e34): undefined reference to `__kmpc_fork_call'
src/HexDialogs.o: In function `.omp_outlined..148':
src/HexDialogs.cpp:(.text+0x14a96): undefined reference to `__kmpc_dispatch_init_4u'
src/HexDialogs.cpp:(.text+0x14ac9): undefined reference to `__kmpc_dispatch_next_4u'
src/HexDialogs.cpp:(.text+0x14b0d): undefined reference to `__kmpc_single'
src/HexDialogs.cpp:(.text+0x14b3b): undefined reference to `__kmpc_end_single'
src/HexDialogs.cpp:(.text+0x14b48): undefined reference to `__kmpc_barrier'
src/HexDialogs.cpp:(.text+0x14b67): undefined reference to `__kmpc_end_single'
c++: error: linker command failed with exit code 1 (use -v to see invocation)

@Peter2121
Copy link
Author

OK, I've got it.
One need to install openmp package, the library from gcc6 does not work correctly here.
I can start wxHexEditor and open files, but it crashes trying to create new file:
Floating point exception (core dumped)

@Peter2121
Copy link
Author

Peter2121 commented Mar 28, 2018

gmake install is failed:

$ gmake install
install -D -m 755 wxHexEditor //usr/local/bin/wxHexEditor
install: target directory `//usr/local/bin/wxHexEditor' does not exist

(I changed prefix in Makefile, without such modification it tries /usr/bin/wxHexEditor and failed the same way)

@EUA
Copy link
Owner

EUA commented Mar 29, 2018

I removed the "-D" and it looks working proper now.
Please try again.

gcc issue is true at FreeBSD. Probably due libs... I think it's nothing to do for me.
I just use clang.

@EUA
Copy link
Owner

EUA commented Sep 27, 2019

Tested with FreeBSD12 and working with instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants