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

Way to build this without x11 stuff #5

Closed
STashakkori opened this issue Oct 15, 2021 · 7 comments
Closed

Way to build this without x11 stuff #5

STashakkori opened this issue Oct 15, 2021 · 7 comments

Comments

@STashakkori
Copy link

Hello. Is there a way to build this without needed the x11 headers? We want to use this as a CLI based tool only and would rather not bring more libraries in than we need. Thank you

@STashakkori
Copy link
Author

Actually, better yet, can you provide prebuilt binaries? I've followed all the steps and ran into this when trying to build:

In file included from /usr/lib/gcc/x86_64-linux-gnu/10/include/immintrin.h:53,
from chacha_avx.cpp:26:
/usr/lib/gcc/x86_64-linux-gnu/10/include/avx2intrin.h: In function ‘__m256i {anonymous}::RotateLeft(__m256i) [with unsigned int R = 8]’:
/usr/lib/gcc/x86_64-linux-gnu/10/include/avx2intrin.h:588:1: error: inlining failed in call to ‘always_inline’ ‘__m256i _mm256_shuffle_epi8(__m256i, __m256i)’: target specific option mismatch
588 | _mm256_shuffle_epi8 (__m256i __X, __m256i __Y)
| ^~~~~~~~~~~~~~~~~~~
chacha_avx.cpp:73:31: note: called from here
73 | return _mm256_shuffle_epi8(val, mask);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-linux-gnu/10/include/immintrin.h:53,
from chacha_avx.cpp:26:
/usr/lib/gcc/x86_64-linux-gnu/10/include/avx2intrin.h:588:1: error: inlining failed in call to ‘always_inline’ ‘__m256i _mm256_shuffle_epi8(__m256i, __m256i)’: target specific option mismatch
588 | _mm256_shuffle_epi8 (__m256i __X, __m256i __Y)
| ^~~~~~~~~~~~~~~~~~~
chacha_avx.cpp:73:31: note: called from here
73 | return _mm256_shuffle_epi8(val, mask);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
make[1]: *** [Makefile:400: Bin-Intermediate/Release-linux-x86_64/cryptopp/chacha_avx.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:124: cryptopp] Error 2

@STashakkori
Copy link
Author

**Update:

Trying this on a different machine that is ubuntu20 instead of 21 and has a newer SoC worked.

@baderouaich
Copy link
Owner

Hello @STashakkori,

Sadly, the only way to build CLI alone is by modifying the Source/Main.cpp, the compiler will cast out the unused libraries. however, libs like x11 should still be present at compile time.

There are already built binaries for Linux & Windows in the Releases, which can be used directly, but they contain CLI and UI code as well.

About the failed build attempt you did, can you give more details on the OS and Distro you are using ?

Thank you.

@baderouaich
Copy link
Owner

**Update:

Trying this on a different machine that is ubuntu20 instead of 21 and has a newer SoC worked.

Glad it worked! by the way you can modify the Source/Main.cpp for CLI only.
Main.cpp for CLI only will look like this:

/**
*	Enigma Entry Point
*/
#include <pch.hpp>

#if ! ENIGMA_TESTING
	#include <Enigma.hpp>
#else	
	#include <Tests/TestsAll.hpp>
#endif

int main(int argc, char* argv[])
{	
	// Initialize Logger
	Enigma::Logger::Initialize();
	// Initialize SQLite3 Database
	Enigma::Database::Initialize();

	Enigma::i32 exit_code = -1;
	
	try
	{
		//========= CLI Entry =========//
		const auto _Cli = std::make_unique<Enigma::CLI>(argc, argv);
		exit_code = _Cli->Run();
	}
	catch (const std::exception& e)
	{
		// Exit Abnormally
		ENIGMA_CRITICAL(e.what());
		exit_code = EXIT_FAILURE;
	}

	// Shutdown SQLite3 Database
	Enigma::Database::Shutdown();
	// Shutdown Logger
	Enigma::Logger::Shutdown();

	return exit_code;
}


/**
*	Windows Entry Point (for Release & Distribution)
*	Note: even when using WinMain, release & dist are built as ConsoleApp so CLI will work properly.
*/
#if defined(ENIGMA_PLATFORM_WINDOWS) && (defined(ENIGMA_RELEASE) || defined(ENIGMA_DIST))

int WINAPI WinMain(
	[[maybe_unused]] _In_ HINSTANCE instance,
	[[maybe_unused]] _In_opt_ HINSTANCE prev_instance,
	[[maybe_unused]] _In_ LPSTR cmd_line,
	[[maybe_unused]] _In_ int cmd_show)
{
	return ::main(__argc, __argv);
}

#endif

@STashakkori
Copy link
Author

Ah ok thank you @BaderEddineOuaich . By the way this is a finely crafted tool. My compliments to the craftsman

@baderouaich
Copy link
Owner

You're welcome!
If you encounter any problems, questions or clarifications, please don't hesitate to open an issue or contact me 👍
Have a nice day!

@STashakkori
Copy link
Author

STashakkori commented Oct 15, 2021 via email

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

No branches or pull requests

2 participants