Skip to content

fix: Include dxf bundle in libgerbv.#367

Closed
eyal0 wants to merge 1 commit intogerbv:developfrom
eyal0:dxf_bundle_in_lib_archive
Closed

fix: Include dxf bundle in libgerbv.#367
eyal0 wants to merge 1 commit intogerbv:developfrom
eyal0:dxf_bundle_in_lib_archive

Conversation

@eyal0
Copy link
Copy Markdown
Collaborator

@eyal0 eyal0 commented Mar 5, 2026

If dxf is not found on the system, include it in libgerbv.a.

This fixes #366.

@eyal0
Copy link
Copy Markdown
Collaborator Author

eyal0 commented Mar 5, 2026

On the current develop branch on a compute that does not have libdxf installed:

└──> objdump -t ./src/libgerbv.a | grep Dxf        
0000000000000000         *UND*	0000000000000000 _ZN6DL_DxfC1Ev
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf3outEPKcN8DL_Codes7versionE
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf11writeHeaderER10DL_WriterA
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf10writeVPortER10DL_WriterA
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf13writeLinetypeER10DL_WriterARK15DL_LinetypeData
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf10writeLayerER10DL_WriterARK12DL_LayerDataRK13DL_Attributes
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf10writeStyleER10DL_WriterARK12DL_StyleData
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf9writeViewER10DL_WriterA
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf8writeUcsER10DL_WriterA
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf13writePolylineER10DL_WriterARK15DL_PolylineDataRK13DL_Attributes
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf11writeVertexER10DL_WriterARK13DL_VertexData
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf16writePolylineEndER10DL_WriterA
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf12writeObjectsER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf15writeObjectsEndER10DL_WriterA
0000000000000000         *UND*	0000000000000000 _ZN6DL_DxfD1Ev
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf8writeArcER10DL_WriterARK10DL_ArcDataRK13DL_Attributes
0000000000000000         *UND*	0000000000000000 _ZN6DL_Dxf11writeCircleER10DL_WriterARK13DL_CircleDataRK13DL_Attributes

We see that all these are undefined.

With the change (I've only included some of the lines):

└──> objdump -t ./src/libgerbv.a | grep Dxf
0000000000004710 g     F .text	0000000000000287 _ZN6DL_Dxf17writeDimAngular3PER10DL_WriterARK16DL_DimensionDataRK19DL_DimAngular3PDataRK13DL_Attributes
00000000000049a0 g     F .text	0000000000000216 _ZN6DL_Dxf16writeDimOrdinateER10DL_WriterARK16DL_DimensionDataRK18DL_DimOrdinateDataRK13DL_Attributes
0000000000004bc0 g     F .text	000000000000012c _ZN6DL_Dxf11writeLeaderER10DL_WriterARK13DL_LeaderDataRK13DL_Attributes
0000000000004cf0 g     F .text	0000000000000041 _ZN6DL_Dxf17writeLeaderVertexER10DL_WriterARK19DL_LeaderVertexData
0000000000004d40 g     F .text	000000000000009f _ZN6DL_Dxf14writeLeaderEndER10DL_WriterARK13DL_LeaderData
0000000000004de0 g     F .text	0000000000000167 _ZN6DL_Dxf11writeHatch1ER10DL_WriterARK12DL_HatchDataRK13DL_Attributes
0000000000004f50 g     F .text	0000000000000176 _ZN6DL_Dxf11writeHatch2ER10DL_WriterARK12DL_HatchDataRK13DL_Attributes
00000000000050d0 g     F .text	0000000000000039 _ZN6DL_Dxf15writeHatchLoop1ER10DL_WriterARK16DL_HatchLoopData
0000000000005110 g     F .text	0000000000000013 _ZN6DL_Dxf15writeHatchLoop2ER10DL_WriterARK16DL_HatchLoopData
0000000000005130 g     F .text	00000000000004f7 _ZN6DL_Dxf14writeHatchEdgeER10DL_WriterARK16DL_HatchEdgeData
0000000000005630 g     F .text	00000000000001f2 _ZN6DL_Dxf10writeImageER10DL_WriterARK12DL_ImageDataRK13DL_Attributes
0000000000005830 g     F .text	0000000000000126 _ZN6DL_Dxf13writeImageDefER10DL_WriterAiRK12DL_ImageData
0000000000005960 g     F .text	000000000000043d _ZN6DL_Dxf10writeLayerER10DL_WriterARK12DL_LayerDataRK13DL_Attributes
0000000000005da0 g     F .text	0000000000000416 _ZN6DL_Dxf13writeLinetypeER10DL_WriterARK15DL_LinetypeData
00000000000061c0 g     F .text	00000000000001cd _ZN6DL_Dxf10writeAppidER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
0000000000006390 g     F .text	00000000000002fa _ZN6DL_Dxf10writeBlockER10DL_WriterARK12DL_BlockData
0000000000006690 g     F .text	0000000000000234 _ZN6DL_Dxf13writeEndBlockER10DL_WriterARKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
00000000000068d0 g     F .text	00000000000004d7 _ZN6DL_Dxf10writeVPortER10DL_WriterA
0000000000006db0 g     F .text	000000000000020b _ZN6DL_Dxf10writeStyleER10DL_WriterARK12DL_StyleData

We see many functions are defined. This will allow users to link to libgerbv.a even if they don't have libdxf installed.

I ran into this problem while working on pcb2gcode: https://github.com/eyal0/pcb2gcode/actions/runs/22734840676/job/65933332720

@eyal0 eyal0 force-pushed the dxf_bundle_in_lib_archive branch 3 times, most recently from f46b90c to be91c06 Compare March 5, 2026 23:50
@eyal0
Copy link
Copy Markdown
Collaborator Author

eyal0 commented Mar 6, 2026

I think that it solved my problem. Previously I was unable to compil available_drills_tests:

https://github.com/eyal0/pcb2gcode/actions/runs/22734840676/job/65933332765#step:29:138

Now it works: https://github.com/eyal0/pcb2gcode/actions/runs/22742163468/job/65957795350#step:29:53

@eyal0 eyal0 force-pushed the dxf_bundle_in_lib_archive branch from be91c06 to c68bf5b Compare March 6, 2026 00:05
If dxf is not found on the system, include it in libgerbv.a.

This fixes gerbv#366.
@rampageservices
Copy link
Copy Markdown
Contributor

This PR can be closed — #368 is a superset that contains this exact commit (74a1a04) plus an additional fix for math.h/M_PI on MSVC. Merging #368 alone covers both changes and resolves #366.

@eyal0
Copy link
Copy Markdown
Collaborator Author

eyal0 commented Mar 6, 2026

#368 is built on top of #367 because I needed both of them in order to get pcb2gcode to work. I think that it would be best to merge this one first and then the other one. That way, each PR can be as small as possible and just handle one thing.

@spe-ciellt
Copy link
Copy Markdown
Contributor

@eyal0 Can you check if the #373 fixed this? If it didn't, please rebase. If it fixed it, please close this and matching issue.

@eyal0
Copy link
Copy Markdown
Collaborator Author

eyal0 commented Mar 7, 2026

I'll close this for now because your solution looks good but i have yet to test that #366 is solved. I will check that soon.

@eyal0 eyal0 closed this Mar 7, 2026
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

Successfully merging this pull request may close these issues.

libgerbv is not installing correctly

3 participants