-
Notifications
You must be signed in to change notification settings - Fork 242
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
How can I compile in mac os .a library #4
Comments
Hello lingdf, To build the MIRACL library, please follow the steps from manual.doc: 1.Compile and run config.c on the target processor. 2.Rename the generated file mirdef.tst to mirdef.h 3.If so advised by the config program, extract a suitable mrmuldv.c file from mrmuldv.any (or copy the standard C version mrmuldv.ccc to mrmuldv.c and use this). If it is pure assembly language it may be appropriate to name it mrmuldv.s or mrmuldv.asm. 4.If the fast KCM or Comba methods for modular multiplication were selected (see below), compile and run the mex.c utility on any workstation. Use it to automatically generate either the module mrcomba.c or mrkcm.c. This will require a processor/compiler-specific xxx.mcs file. The compiler must support inline assembly. 5.Make sure that all the MIRACL header files are accessible to the compiler. Typically the flag –I. or /I. allows these headers to be accessed from the current directory. 6.Compile the MIRACL modules listed in the generated file miracl.lst and create a library file, typically miracl.a or miracl.lib. This might be achieved by editing miracl.lst into a suitable batch or make file. On UNIX it might be as simple as:- gcc –I. –c –O2 mr_.c 7.If using the C++ MIRACL wrapper, compile the required modules, for example zzn.cpp and/or big.cpp etc. 8.Compile and link your application code to any C++ modules it requires and to the MIRACL library. You can find the manual.doc file here: |
I did the same steps but I still get some errors about _asm. Any idea why I am getting this error?? Mac OS X 10.10. mrmuldv.c:12:9: error: use of undeclared identifier '_asm' |
Hello Gungor, Unfortunately I know nothing about Macs. Have a look around line 1422 of miracl.h - it looks like this #define is #define ASM _asm which should only happen for the Microsoft compiler (??) So I am assuming you are using the Microsoft C compiler. If so, then maybe try changing this line to #define ASM asm If that fails try __asm, or check your compiler documentation to find out On Windows boxes, _asm works fine. Mike On Sun, Oct 19, 2014 at 8:37 AM, Güngör notifications@github.com wrote:
Michael Scott |
Hello, When I try to compile, it could not find the one header file in the source folder. Probably it was "miracle.h". Then I copied that file from the include folder. That might be the reason for my problem then. By the way, I am definitely not using microsoft compiler. I am using gcc. |
I took the "linux64" compile script on Mac OSX 10.10 and ran it with "bash linux64". That was flawless and no problem, miracle.a was build. But afterwards, when trying to use it, the gcc (or g++ or clang++, etc.) always complaining about "ld: symbol(s) not found for architecture x86_64" |
More information required. What symbol is not found? Mike On Wed, Feb 11, 2015 at 9:28 PM, coliban notifications@github.com wrote:
Michael Scott |
Thank you, mcarrickscott, on the mac (Yosemite, 10.10.2) , there has to be set an environment variable: MACOSX_DEPLOYMENT_TARGET=10.9 and then it is compiling with no problem |
Great! Mike On Thu, Feb 12, 2015 at 7:26 PM, coliban notifications@github.com wrote:
Michael Scott |
I followed the steps in #4 (comment) to compile on 64bit Mac OS X (10.9) but after I run
I end up getting errors as shown in gist https://gist.github.com/sumproxy/81cce102c175b8ec1e10#file-output |
Show me mirdef.h file that you are using Mike On Thursday, July 2, 2015, Sum Proxy notifications@github.com wrote:
Michael Scott "Those who give up essential security to purchase a slightly better user |
That's the header for a 32 bit build. Mike On Thu, Jul 2, 2015 at 11:22 AM, Sum Proxy notifications@github.com wrote:
Michael Scott "Those who give up essential security to purchase a slightly better user |
Now I get a bunch of warnings https://gist.github.com/sumproxy/ce8826ce137cd3c36323#file-gistfile1-txt |
btw thanks for all your help so far |
Just downloaded miracl.zip to a clean directory on my mini-mac, executed "unzip -j -L -aa miracl.zip” and followed that with “bash linux64”. This worked fine and built a 64-bit version of the miracl library - miracl.a mike https://cvx.slack.com/team/mike[6:54 PM] Mike
|
In fact the C++ work-around is quite simple. Substitute the attached files for a clean "bash linux64" build Mike
|
I followed the instructions in linux.txt but still got errors: https://gist.github.com/sumproxy/3e34e60395c3b87a124c#file-gistfile1-txt |
You didn't substitute the files big.h big.cpp zzn.h and zzn.cpp that I sent These files have the work-around for the gcc issue on macs Mike On Fri, Jul 3, 2015 at 10:41 AM, Sum Proxy notifications@github.com wrote:
Michael Scott "Those who give up essential security to purchase a slightly better user |
It's funny but I don't get confirmation email from certivox.com, tried a number of times |
I don't understand.. Mike On Fri, Jul 3, 2015 at 11:09 AM, Sum Proxy notifications@github.com wrote:
Michael Scott "Those who give up essential security to purchase a slightly better user |
You mean this https://cvx.slack.com/team/mike? |
I was trying to register a certivox account, which probably not where the files you sent are. Can't figure out where I can find them. Sorry for the confusion. Can't find the files in github either |
You tell me where to send them… Mike
|
sure: sumproxy(at)gmail(dot)com |
hej, macon stage of running linux64
@mcarrickscott, is not quite clear about life saving files? May you please write something in README, clarify in discussion? |
I think the attached files fixed the problem. In gcc on a mac a member function in for example big.h like
{ return big_to_bytes(max,b.fn,ptr,justify);} which has a default parameter ("justify=FALSE") must be be inlined like this So do a clean download of MIRACL, and substitute these files, then do bash Mike On Thu, Aug 6, 2015 at 2:11 PM, lesyk notifications@github.com wrote:
Michael Scott "Those who give up essential security to purchase a slightly better user |
@mcarrickscott, @sumproxy thx! |
@mcarrickscott I'm currently also having trouble building MIRACL on OSX. I tried going to https://cvx.slack.com/team/mike , but I cannot create an account to access these files on this site. Could you possibly make these available somewhere public? |
Can you give me more details of the problems you are having? Installing MIRACL on OSX should just be a matter of unzip -j -L -aa miracl.zip followed by bash linux64 There is also a known problem with the mac port of g++ involving friend If this is your problem, try substituting the attached files Mike On Sat, Jan 23, 2016 at 8:53 PM, RobTrifiletti notifications@github.com
|
Dear Mike, |
I did attach the files to my email, but it seems they didn't get through to Give me an email address and I will send them directly to you. The changes friend void foo() {} in big .h (which should work - in-lining functions like this is OK) change to friend void foo(); and insert void foo() {} into big.cpp Mike On Mon, Jan 25, 2016 at 3:02 PM, RobTrifiletti notifications@github.com
|
I see. I would greatly appreciate if you could send me the modified files though. Thank you for your help!
|
I tried to build Miracl on Mac 10.11.3 recently and also met the same friend declarations problems as RobTrifiletti I will appreciate if you could send me those modified files by email. My email is iosdev@eetrust.com |
Long time. When I am home I will see what I will find and send it. Mit freundlichen Grüßen
|
Here they are.. Mike On Tue, Jun 21, 2016 at 7:26 AM, LarkNan notifications@github.com wrote:
|
@mcarrickscott |
@mcarrickscott @coliban |
Hi, I just created a patch file that solves the compilation issue: https://gist.github.com/cygnusv/a1710ed5c1e74ac77ea0643266f0a15f |
@mcarrickscott |
Hello,
Find attached
Mike
…On Thu, Mar 9, 2017 at 7:20 AM, H_Lin ***@***.***> wrote:
@mcarrickscott <https://github.com/mcarrickscott>
Would you please also send me the modified files since I am also trying to
compile the Miracl library on Mac? Thanks a lot. My email is
***@***.*** Thank you in advance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACm8jmx0p5SPlG_l8xAEiH_HFpsXeQw3ks5rj6hBgaJpZM4Bw147>
.
|
Hello Mike,
Thank you for your prompt response. But I don't find anything attached to
your message. Did I miss something? Please let me know. Thanks a lot.
Best,
Huang
On Thu, Mar 9, 2017 at 4:40 PM, Michael Scott <notifications@github.com>
wrote:
… Hello,
Find attached
Mike
On Thu, Mar 9, 2017 at 7:20 AM, H_Lin ***@***.***> wrote:
> @mcarrickscott <https://github.com/mcarrickscott>
> Would you please also send me the modified files since I am also trying
to
> compile the Miracl library on Mac? Thanks a lot. My email is
> ***@***.*** Thank you in advance.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#4 (comment)>, or
mute
> the thread
> <https://github.com/notifications/unsubscribe-
auth/ACm8jmx0p5SPlG_l8xAEiH_HFpsXeQw3ks5rj6hBgaJpZM4Bw147>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIGdI8zdVYtam4uMSj6s9Nr1Vd9-xG-Sks5rj7r8gaJpZM4Bw147>
.
|
@mcarrickscott Can you please send me files which I need to replace, to solve friend function error in OSX? My mail id is Thanks. |
Dear Michael Scott |
Sorry, just not enough information there to enable me to help. For example
which parameter is causing the conflict? And what is the declaration in
miracl.h conflicting with?
Mike
…On Wed, Nov 14, 2018 at 10:45 AM Atbnsanw ***@***.***> wrote:
I did attach the files to my email, but it seems they didn't get through to
you.
Give me an email address and I will send them directly to you. The changes
are minimal. Rather than
friend void foo() {}
in big .h (which should work - in-lining functions like this is OK)
change to
friend void foo();
and insert
void foo() {}
into big.cpp
Mike
On Mon, Jan 25, 2016 at 3:02 PM, RobTrifiletti ***@***.***
wrote:
Dear Mike,
Yes, my problem is the friend declarations. You say I should substitute
the attached files. I might be foolish here, but I dont see any attached
files in this thread. I thought you meant at
https://cvx.slack.com/team/mike, but as I said before I cannot access
this area.
Thanks!
—
Reply to this email directly or view it on GitHub
#4 (comment)
<#4 (comment)>.
Dear Michael Scott
I have installed Miracl and I can linked it by gcc command ,but I can't
use it in Xcode.Xcode always says "Conflicting types for 'instr'". It
happens in miracl.h,"extern int instr(*MIPT* flash,char *);",this line.I
don't know how to deal it.Would you please help me?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACm8jpopQ0XgmDuZgPslkQylR4mkKU3dks5uu_RUgaJpZM4Bw147>
.
|
This: |
My miracl.h:https://github.com/Atbnsanw/error_miracl_headfile/blob/master/error_miracl_headfile. |
Since miracl.h already includes mirdef.h, try removing line 3 #include
"mirdef.h" from main.c
It is not needed.
Mike
…On Wed, Nov 14, 2018 at 12:29 PM Atbnsanw ***@***.***> wrote:
Sorry, just not enough information there to enable me to help. For example
which parameter is causing the conflict? And what is the declaration in
miracl.h conflicting with? Mike
… <#m_3052967364361243224_>
On Wed, Nov 14, 2018 at 10:45 AM Atbnsanw ***@***.***> wrote: I did attach
the files to my email, but it seems they didn't get through to you. Give me
an email address and I will send them directly to you. The changes are
minimal. Rather than friend void foo() {} in big .h (which should work -
in-lining functions like this is OK) change to friend void foo(); and
insert void foo() {} into big.cpp Mike On Mon, Jan 25, 2016 at 3:02 PM,
RobTrifiletti ***@***.*** wrote: Dear Mike, Yes, my problem is the friend
declarations. You say I should substitute the attached files. I might be
foolish here, but I dont see any attached files in this thread. I thought
you meant at https://cvx.slack.com/team/mike, but as I said before I
cannot access this area. Thanks! — Reply to this email directly or view it
on GitHub #4 <#4> (comment) <#4
(comment)
<#4 (comment)>>. Dear
Michael Scott I have installed Miracl and I can linked it by gcc command
,but I can't use it in Xcode.Xcode always says "Conflicting types for
'instr'". It happens in miracl.h,"extern int instr(*MIPT* flash,char
*);",this line.I don't know how to deal it.Would you please help me? — You
are receiving this because you were mentioned. Reply to this email
directly, view it on GitHub <#4 (comment)
<#4 (comment)>>, or
mute the thread
https://github.com/notifications/unsubscribe-auth/ACm8jpopQ0XgmDuZgPslkQylR4mkKU3dks5uu_RUgaJpZM4Bw147
.
This:
[image: image]
<https://user-images.githubusercontent.com/37361106/48482124-c4b1a300-e84a-11e8-957b-852241e28b5b.png>
[image: image]
<https://user-images.githubusercontent.com/37361106/48482162-ea3eac80-e84a-11e8-9d41-4f6ec08da8b7.png>
And all files in folder are:
[image: image]
<https://user-images.githubusercontent.com/37361106/48482354-6f29c600-e84b-11e8-867d-c1f81ef46017.png>
And I can use command:"gcc -o main main.c -I.. libmiracl.a ",compilie
successfully.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACm8jsUo5aB81n_laL6hZtBQVf9FKNLAks5uvAyQgaJpZM4Bw147>
.
|
I tried, and still failed. |
Ah, OK. That's always a potential problem with C - a function name clash
with another library.
I suggest that you edit ALL of the miracl library files and replace
instr(..) everywhere with (for example) mr_instr(..)
That should fix it.
Mike
…On Wed, Nov 14, 2018 at 1:38 PM Atbnsanw ***@***.***> wrote:
Since miracl.h already includes mirdef.h, try removing line 3 #include
"mirdef.h" from main.c It is not needed. Mike
… <#m_44160497638197421_>
I tried, and still failed.
[image: image]
<https://user-images.githubusercontent.com/37361106/48486009-460e3300-e855-11e8-80ef-e46124bb7e90.png>
[image: image]
<https://user-images.githubusercontent.com/37361106/48486036-545c4f00-e855-11e8-9c0d-be1b656f1ba2.png>
This two place all announced "instr" function. Should I change one of them?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACm8jslZ6oSukkTI9vdD9m_M7NoMqeRwks5uvBzggaJpZM4Bw147>
.
|
Thanks for your help, now I have fixed it.This function appears only once in ‘miracl.h'.Now I can use Miracl properly.Thank you very much. |
Hello Mike, |
Hello,
Not really enough details, but I suspect the problem arises because of the
"runs some other code".
MIRACL is not natively multi-threaded, and by default curve constants such
as the modulus are stored as elements of the single global instance of the
miracl structure defined in miracl.h. The single instance of this structure
is pointed to be mr_mip.
Basically when you "run some other code" I suspect that the value of mr_mip
has been forgotten, or gone out of scope.
Maybe you could copy it and restore it after running the "other code"? Or
maybe you could just re-initialise the miracl code after the "other code"?
Mike
…On Fri, Dec 21, 2018 at 12:45 PM Atbnsanw ***@***.***> wrote:
Ah, OK. That's always a potential problem with C - a function name clash
with another library. I suggest that you edit ALL of the miracl library
files and replace instr(..) everywhere with (for example) mr_instr(..) That
should fix it. Mike
… <#m_6414416131447797624_>
Hello Mike,
I meet a new problem and I spent the whole day trying to solve it,but i
failed. Will you do me a favour?
When i use epoint_set() funcition ,first time it runs normally, then runs
some other code , then when I call this function for the second time, the
error appears:
" MIRACL error from routine nres
called from epoint_set
called from your program
No modulus defined"
I looked it up in the manual, and it said so:
" Message: No modulus defined
Diagnosis: No modulus has been specified, yet a function which needs it
has been called.
Response: Set a modulus for use internally "
I don't know how to set this function right,because first time this
function can work normally.
I would appreciate it very much if you could help me
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACm8jtTejzRu8gg1ZOSXp9iVKRxka6Arks5u7NfRgaJpZM4Bw147>
.
|
Thank you very much for taking the time to help me.I add extra mirsys() functions to solve the problem. I use mirsys() in a separate function ,and perhaps this is the cause of the problem.My understanding is when i use mirsys in a separate function, it will overwrite the original settings, and after the separate function ended, all miracl setting and memory space are also released? So i have to add extra mirsys() functions every time after using mirsys() in a separate function. |
Hello,dear friends. mrarth1.c:56:10: fatal error: 'ieeefp.h' file not found Could you please tell me why I am getting those error?Or could you please let me use your miracl library that you have compiled?Nowadays I have an assignment that required the miracl library. Thank you very much. |
How can I compile in mac os .a library and Which is what I need the source files
The text was updated successfully, but these errors were encountered: